Finding files via SSH Print

  • 42

Finding files and content in the command line can be tricky sometimes, but with a bit know know-how you should be able to handle it like a pro in no time.

And here is how: 

1) Use 'find' to search for a file by it's name. Like:

find -iname "file"

Iname would ignore the case, which is very usefull in most cases.

If you want to search in a specific location or root, in this case, you just need to insert the location, like:

find /  -iname "file"

Wilcards can help you find more general names containing parts that you want to look for:

find /home   -iname "*.jpeg"

You can also specify the type, you have the options of regular files (f), directories (d), symbolic links (1), character devices (c), and block devices (b) by using the right modifier.

find /home -type f  -iname "*.jpeg"

Or size:

find /home -size +1M  -iname "*.jpeg"

Was this answer helpful?

« Back