Thursday 29 September 2011

How to search files in unix/linux env


find PATH -name 'FILE.extn'

  • find: Find is a command 
  • PATH: Where do you want to search. /home will focus the search in home directory. If you are not sure about the path, mention /. This symbol stands of root. All directories will be searched including mounted filesystems.
  • -name: This option makes the search case sensitive. -iname option to find something regardless of case.
  • 'FILE.extn': File name that you are searching
Example:


  1. find / -name 'gc.dat'
  2. find /home -name 'gc.dat'
  3. find / -iname 'gc.dat'

No comments:

Post a Comment