Skip to content

Instantly share code, notes, and snippets.

@MrThreat
Created October 19, 2017 03:37
Show Gist options
  • Save MrThreat/a602f95320a85043e60a0c661cccd582 to your computer and use it in GitHub Desktop.
Save MrThreat/a602f95320a85043e60a0c661cccd582 to your computer and use it in GitHub Desktop.
Finding files linux file system
grep pattern files – Search for the pattern in files
grep -r pattern dir – Search recursively for the pattern in dir
command | grep pattern – Search for the pattern in the output of the command
locate file – Find all instances of the file
find / -name filename – Starting with the root directory, look for the file called filename
find / -name ”*filename*” – Starting with the root directory, look for the file containing the string filename
locate filename – Find a file called filename using the locate command; this assumes you have already used the command updatedb
updatedb – Create or update the database of records on all file systems attached to the Linux root directory
which filename – Show the subdirectory containing the executable file called filename
grep TextStringToFind /dir – Starting with the directory called dir, look for and list all files containing TextStringToFind
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment