See more...

[Linux TidBits] Finding Files And Text Within Files

Here are few commands commonly used in linux for finding files and text within files. These commands are very useful in finding files and texts within files and directories, and are largely used in Linux OS environments/bash scripting.

find / -name fname

{This command starts looking from root directory, for the file called fname}

find / -name ”*fname*”

{Starting with the root directory, look for the file containing the string fname}

locate missingfilename

{Find a file called missingfilename using the locate command - this assumes you have already used the command updatedb (see next)}


{Create or update the database of files on all file systems attached to the linux root director}

which missingfilename

{Show the subdirectory containing the executable file called missingfilename}

grep textstringtofind /dir

{Starting with the directory called dir, look for and list all files containing textstringtofind}

Contact Us for News Tips, Corrections and Feedback
Leave a message...