One linux command (16) every day: which command link: One linux command (1) every day: ls command http://www.2cto.com/ OS /201210/163049.html#linuxlinuxcommand (2) every day: cd command quit ..
One linux command every day (16): which command link: One linux command every day (1): ls command http://www.2cto.com/os/201210/163049.html ; One linux command every day (2): cd command http://www.2cto.com/os/201210/163050.html ; One linux command every day (3): pwd command http://www.2cto.com/os/201210/163462.html ; One linux command every day (4): mkdir command http://www.2cto.com/os/201210/163463.html ; One linux command every day (5): rm command http://www.2cto.com/os/201210/163662.html ; One linux command (6) every day: rmdir command http://www.2cto.com/os/201210/164017.html ; One linux command (7) every day: mv command http://www.2cto.com/os/201210/164247.html ; One linux command every day (8): cp command http://www.2cto.com/os/201210/164254.html ; One linux command every day (9): touch Command http://www.2cto.com/os/201211/165699.html ; One linux command every day (10): cat command http://www.2cto.com/os/201211/165989.html ; One linux command every day (11): nl command http://www.2cto.com/os/201211/165990.html One linux command every day (12): more command http://www.2cto.com/os/201211/165994.html One linux command every day (13): less command http://www.2cto.com/os/201211/165998.html One linux command every day (14): head Command http://www.2cto.com/os/201211/166191.html One linux command every day (15): tail command http://www.2cto.com/os/201211/168702.html We often search for a file in linux, but do not know where it is stored. you can use the following command to search: which to view the location of the executable file. Www.2cto.com whereis. Use locate with the database to view the file location. Find actual search hard disk query file name. The which command searches for the location of a system command in the PATH specified by the PATH variable and returns the first search result. That is to say, by using the which command, you can see whether a system command exists and where the command is executed. 1. command format: which executable file name 2. command function: the which command searches for the location of a system command in the PATH specified by the PATH variable and returns the first search result. 3. command parameter:-n specifies the file name length. the specified length must be greater than or equal to the longest file name in all files. The-p and-n parameters are the same, but the file path is included here. -W specifies the width of the field when the output is made. -V: Display version information 4. use instance: instance 1: search for files, display command path command: which lsmod output: [root @ localhost ~] # Which pwd/bin/pwd [root @ localhost ~] # Which adduser/usr/sbin/adduser [root @ localhost ~] # Note: which searches for runnable files based on the directory in the PATH variable configured by the user! Therefore, the commands found for different PATH configurations are certainly different! Instance 2: Use which to locate which command: which output: [root @ localhost ~] # Which whichalias which = 'Alias |/usr/bin/which -- tty-only -- read-alias -- show-dot -- show-tilde'/usr/bin/which [root @ localhost ~] # Note: there will actually be two which, one of which is alias. this is the so-called "command alias", which means that the input of which will wait for the subsequent commands! Instance 3: Find the cd command: which cd output:
Note: the commonly used cd command cannot be found! Why? This is because cd is a built-in bash command! However, by default, which finds the standard directory in the PATH, so it must not be found!
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service