To find files and configurations in Linux you can use the find and whereis commands.
Whereis who’s you the folders where data for applications are stored. Find allows you to search for files and folders on the system.
- whereis php – shows where PHP files are stored.
- You can run whereis from any directory and do not need to use sudo.
- Find allows you to search your system for files and folders. If you receive permission issues or an odd response try using sudo.
- sudo find / -name ‘test.txt’ – command / location to start from (if left blank find starts from the folder you are in / argument / file being searched for.
- -name – case sensitive search
- find -name ‘test.txt’
- -iname – case insensitive search
- find -iname ‘test.txt’
- -user – searches based on user owner
- find -user ‘bob’
- -cmin – searches based on time since a file was modified
- find -cmin -10