Linux – Find Files in Linux (find, whereis)

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: http://manpages.ubuntu.com/manpages/cosmic/man1/whereis.1.html

Find: http://manpages.ubuntu.com/manpages/xenial/en/man1/find.1.html

Whereis

  • whereis php – shows where PHP files are stored.
  • You can run whereis from any directory and do not need to use sudo.

Find

  • 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

2 Comments

Leave a Reply