LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   find files in text-only? (https://www.linuxquestions.org/questions/linux-general-1/find-files-in-text-only-186442/)

orange400 05-27-2004 06:10 AM

find files in text-only?
 
How would I find a file on a text-only RH9 system?

btmiller 05-27-2004 06:16 AM

Oddly enough, with the find command. The find command has a LOT of options, and it's well worth reading through its man page to skinny the skinny on everything. But assuming you know the name of the file you want to locate you can do 'find <dir> -name <filename> -print' where <dir> is the directory you want the search to start in. It will search that directory recursively and print out all files matching the name.

You can also use the locate command, which is faster since it has a cached database of file locations, but if your file was created since the last database update (usually happens out of root once a day) you won't be able to find it. You can update the database by becoming root and typing the 'updatedb' command at the prompt.

lepricaun 05-27-2004 07:50 AM

find / -name filename

where / is the directory and filename is ... the filename :)


All times are GMT -5. The time now is 04:21 AM.