Home arrow Journal arrow Search Files on Command Line by Extension
Search Files on Command Line by Extension PDF
Sunday, 02 November 2014
If you want to search files by extension on FreeBSD's shell here is a simple way to do it by using find command:
 
  find /home -type f -name "*.jpg"

asuming that we want to search for files that end with .jpg extension.

If we have a lot of files we cand send the output to a file:

  find /home -type f -name "*.jpg"

Note that in our example find will look for jpg files in our /home directory and in all subdirectories from /home.

 
< Prev   Next >

Other BSD Systems

OpenBSD

Misc

Solaris

Polls

Best BSD firewall?