'What is the difference between using "." and "/" in the "find" command in linux bash? [closed]

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



Solution 1:[1]

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"

Solution 2:[2]

find / means searching on the root directory, /;

find . means searching on the current directory, .;

find ./ is identical to find ..

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Emanuel Couto
Solution 2 Futarimiti