📎 Webclip
How to find a file in linux
The page explains that in Unix-like systems you can use the find command to locate a file. It gives the basic pattern find {directory-name} -name {filename} and then shows two uses: searching from / when you do not know where the file is, and searching inside a specific directory such as /Users/mkyong.
Reading notes#
- Use
find {directory-name} -name {filename}to search for a file. - To search the whole system, run
sudo find / -name 'testing.txt'. - Searching from
/may require permission, so the example usessudo. - To search only within one directory and its subdirectories, run
sudo find /Users/mkyong -name 'testing.txt'.
