In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces how to use which command in Linux, which has certain reference value. Interested friends can refer to it. I hope you will gain a lot after reading this article. Let Xiaobian take you to understand it together.
Linux common command which command is used to find and display the absolute path of a given command, the environment variable PATH stores the directory that needs to be traversed when finding the command.
which Finds and displays the absolute path of a given command
The which directive looks for files that match the criteria in the directory where the environment variable $PATH is set. In other words, using which command, you can see whether a system command exists and where the command is executed.
syntax which(option)(parameter) option-n: specifies the file name length, the specified length must be greater than or equal to the longest file name of all files; -p: same as the-n parameter, but here contains the path of the file; -w: specifies the width of the field when outputting; -V: displays version information. Parameter Command Name: List of command names.
Instance Find file, Show command path:
[root@localhost ~]# which pwd /bin/pwd [root@localhost ~]# which adduser /usr/sbin/adduser Description: which is based on the directory in the PATH variable configured by the user to search for runnable files! So, different PATH configuration content found by the command is certainly not the same!
Use which to find CD
[root@localhost ~]# which cd cd: shell built-in commandcd This commonly used command unexpectedly can not be found ah! Why is that? This is because cd is a built-in command of bash! But which default is to find the directory specified in PATH, so of course it must not be found!
Thank you for reading this article carefully. I hope that the article "How to use which command in Linux" shared by Xiaobian will be helpful to everyone. At the same time, I hope that everyone will support it a lot and pay attention to the industry information channel. More relevant knowledge is waiting for you to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.