Ricerca per nome file
Come ha menzionato Chris nella sua risposta, puoi usarlo findper farlo, ma trovo molto più veloce la ricerca nel locatedatabase.
Supponendo che la tua distribuzione fornisca questa funzione, la maggior parte di quelli grandi lo fanno, Ubuntu, Fedora, CentOS, ecc.
Esempio
$ locate --basename .mp4 .mkv .wmv .flv .webm .mov .avi | head -5
/home/saml/Desktop/sample_mpeg4.mp4
/home/saml/Downloads/Karrolls_Christmas/Karroll's Christmas (2004) part 1.mp4
/home/saml/Downloads/Karrolls_Christmas/Karroll's Christmas (2004) part 10.mp4
/home/saml/Downloads/Karrolls_Christmas/Karroll's Christmas (2004) part 2.mp4
/home/saml/Downloads/Karrolls_Christmas/Karroll's Christmas (2004) part 3.mp4
Ricerca per tipo di file
Per trovare i file per tipo è possibile utilizzare il comando fileper ottenere un elenco di informazioni sul tipo di un determinato file.
Ecco un elenco approssimativo di questi tipi di file dal mio sistema, Fedora 19.
- .mp4: supporti ISO, sistema MPEG v4, versione 1
- .mkv: file EBML, creatore matroska
- .wmv: Microsoft ASF
- .flv: Macromedia Flash Video
- .webm: WebM
- .mov: ISO Media, filmato Apple QuickTime
- .avi: AVI
Puoi usare questo comando per trovare tutti i file nella tua /home/<user>directory.
$ find /home/<user> -type f -exec file {} + | \
grep -E "MPEG v4|EBML|\
Microsoft ASF|Macromedia Flash Video|WebM|Apple QuickTime movie|AVI"
In alternativa puoi usare filee cercare per tipo mime che sono classificati come "video".
-i, --mime
Causes the file command to output mime type strings rather than
the more traditional human readable ones. Thus it may say
‘text/plain; charset=us-ascii’ rather than “ASCII text”.
Adattando ciò che abbiamo fatto sopra a qualcosa del genere:
$ find /home/<user> -type f -exec file -i {} + | grep video
Puoi usare sedper ottenere solo i nomi dei file:
$ find /home/<user> -type f -exec file -i {} + |
sed -n '/video/s/:[^:]\+$//p'
/home/ravbholua/Downloads/Music_Command_line/[SOLVED] a code question regarding music file extensions_files/avatar774785_6.gif: image/jpeg; charset=binaryUn'altra riga dell'output è:/home/ravbholua/Free Computer Networking Books Download | Ebooks Online Textbooks.html: text/html; charset=iso-8859-1Ho bisogno solo dei file video che verranno eseguiti nel lettore vlc, ecc.