mercredi 19 juin 2013

How to find files in Linux using 'find'

Files can be found under Linux in many different ways. Using the find tool is one of the best ways to find files. The find tool has a huge number of parameters which can be set so that Linux finds exactly those files that you were searching for. 

Many users use the find tool with just the basic parameters. They get the results that they were looking for.

 Unfortunately most of the users don't spend time to learn all about find. If they do, they can make excellent use of this tool and I am sure you would be surprised at the possibilities.

In case you just want to know where a particular file exists on your system, and nothing else is required, then use locate tool



$ find / -name 'program.c'




/
Start searching from the root directory (i.e / directory)
-name
Given search text is the filename rather than any other attribute of a file
'program.c'
Search text that we have entered. Always enclose the filename in single quotes

Aucun commentaire:

Enregistrer un commentaire