Finding things in Linux:
which Shows the full path of shell commands found in your path. For example, if you want to know exactly where the “grep” command is located on the file system, you can type “which grep”. The output should be something like: /bin/grep
whereis Locates the program, source code, and manual page for a command (if all information is available). For example, to find out where “ls” and its man page are, type: “whereis ls” The output will look something like:
ls: /bin/ls /usr/share/man/man1/ls.1.gz
locate A quick way to search for files anywhere on the filesystem. For example, you can find all files and directories that contain the name “mozilla” by typing:
locate mozilla
If you find "command no found" message in debian, you have to install locate by following process. "apt-get install locate" then run "updatedb".
find A very powerful command, but sometimes tricky to use. It can be used to search for files matching certain patterns, as well as many other types of searches. A simple example is:
find . -name \*mp3
This example starts searching in the current directory “.” and all sub-directories, looking for files with “mp3” at the end of their names.
No comments:
Post a Comment