Linux command: find

From RHS Wiki
Revision as of 15:47, 9 August 2018 by Rafahsolis (talk | contribs)
Jump to navigation Jump to search

find files

find <path> -name <filename>

find files modified in the last 24h

find <path> -mtime -1 -ls

find case ignoring

find . -iname "fileName.txt"

find video files

find . -type f -exec file -N -i -- {} + | grep video

or if you only want the filenames ...

find . -type f -exec file -N -i -- {} + | sed -n 's!: video/[^:]*$!!p'

Exclude extension

find Vídeos/popcorntime/ -type f -not -name "*.torrent" -not -name "*.jpg" -not -name "*.srt" -not -name "*.txt" -exec mv "{}" /media/rafa/HM_030/video/ \;