• Uncategorized

About linux : What-is-the-difference-between-using-and-in-the-find-command-in-linux-bash-closed

Question Detail

I am really confused as to when do I use . and when / when trying to find files in linux?

Question Answer

The / in unix means the root of your filesystem and . the current directory you’re at.

You use / when you want to find a file on your entire filesystem and . from the current directory.

So something like:

# Find foo.png on your entire filesystem
find / -name "foo.png"

# Find foo.png from the current directory
find . -name "foo.png"

find / means searching on the root directory, /;

find . means searching on the current directory, .;

find ./ is identical to find ..

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.