How to move all VCard files to other directory based on file content, ignoring the filename
This command will identify all VCard files in a directory by file content (not by file extensin recursively using the file
command (looking for text/vcard
MIME types) and move those to a different directory.
mkdir -p ../VCards && find . -type f -exec sh -c '
case $( file -bi "$1" ) in (text/vcard*) exit 0; esac
exit 1' sh {} \; -exec mv -v --backup=numbered {} ../VCards \;
Based on this StackExchange post. Also see How to move all images to other directory based on file content, ignoring the filename and How to move all videos to other directory based on file content, ignoring the filename and How to move all OOXML (Word .docx/Excel .xlsx) files to other directory based on file content, ignoring the filename