| Description | Shortcut key |
| Search for pattern in files | grep pattern files |
| Search recursively for pattern in dir | grep -r pattern dir |
| Search for pattern in the output of command | command | grep pattern |
| Find all instances of file | locate file |
| 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 | find / -name "*filename*" |
| Find a file called filename using the locate command; this assumes you have already used the command updatedb | locate filename |
| Create or update the database of files on all file systems attached to the Linux root directory | updatedb |
| Show the subdirectory containing the executable file | which filename |
| Starting with the directory called dir, look for and list all files containing TextStringToFind | grep TextStringToFind /dir |
No comments:
Post a Comment