Finding files via SSH

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"
  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

How to run MTR to diagnose network issues

MTR is a network diagnostic tool that combines traceroute and ping utilities. It enables system...

Archiving and extracting with Tar & Gzip

Tar is the best tool to pack an archive and Gzip is the most widely used archive type when using...

SSH connection to MySQL

Connecting to your MySQL server via SSH can be very useful for developers and system admins and...

Using Putty to connect via SSH

Connecting to your Linux server via SSH is usually done via Putty at...

Using grep to search inside files

One very important tool that Unix provides is the grep command, which processes files line by...