Switches
regextype type:-Changes the regular expression syntax understood by -regex.
Supported types:
posix-awk
posix-basic
posix-egrep
posix-extended.
-regex:-File name matches regular expression patter.
Adding this, to find all the files with an extension ending as mov/mp3, execute the below command,
=-=-=-=-=-
find / -regextype posix-extended -iregex '.*\.(mp3|mov)'
=-=-=-=-=-
To append an extension for a file, as as below,
=-=-=-=-=-
find . -type f -exec mv '{}' '{}'.txt \;
=-=-=-=-
which add .txt to all the files.
To find files owned by a particular user
=-=-=-=-
find <dir> -user <username>
=-=-=-=-
To find files not owned by a particular user
=-=-=-=-
find <dir> ! -user <username>
=-=-=-==-
To change ownership of files not owned by a particular user
=-=-=-=-
find <dir> ! -user <username> -exec chown user.user {} \;
=-=-=-=-
To find files that are not equal to a particular extension live .mov, execute as below,
=-=-=-
find . ! -path "*.mov*"
=-=-=-=-
regextype type:-Changes the regular expression syntax understood by -regex.
Supported types:
posix-awk
posix-basic
posix-egrep
posix-extended.
-regex:-File name matches regular expression patter.
Adding this, to find all the files with an extension ending as mov/mp3, execute the below command,
=-=-=-=-=-
find / -regextype posix-extended -iregex '.*\.(mp3|mov)'
=-=-=-=-=-
To append an extension for a file, as as below,
=-=-=-=-=-
find . -type f -exec mv '{}' '{}'.txt \;
=-=-=-=-
which add .txt to all the files.
To find files owned by a particular user
=-=-=-=-
find <dir> -user <username>
=-=-=-=-
To find files not owned by a particular user
=-=-=-=-
find <dir> ! -user <username>
=-=-=-==-
To change ownership of files not owned by a particular user
=-=-=-=-
find <dir> ! -user <username> -exec chown user.user {} \;
=-=-=-=-
To find files that are not equal to a particular extension live .mov, execute as below,
=-=-=-
find . ! -path "*.mov*"
=-=-=-=-