In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
Linux how to use CDPATH to set up the base directory, many novices are not very clear about this, in order to help you solve this problem, the following editor will explain in detail for you, people with this need can come to learn, I hope you can get something.
Use the CD command of CDPATH to set the base directory under Linux
Under Linux, we often use the cd command to enter a directory, but if you often use the CD command to enter a subdirectory under a specific directory, you can set CDPATH to that directory. When you enter the subdirectory under it using cd, you do not need to type the directory name, as shown below:
one
two
three
four
five
six
seven
eight
nine
ten
[ramesh@dev-db ~] # pwd
/ home/ramesh
[ramesh@dev-db ~] # cd mail
-bash: cd: mail: No such file or directory
[note: the above attempt is to enter the mailsubdirectory under the current directory]
[ramesh@dev-db ~] # export CDPATH=/etc
[ramesh@dev-db ~] # cd mail
/ etc/mail
[note: the above is the mail directory under / etc, not the mail directory under the current directory] [ramesh@dev-db / etc/mail] # pwd
/ etc/mail
If you want the setting to be valid, you can write export CDPATH=/etc to ~ / .bash_profile. Similar to the environment variable PATH, you can also add multiple directory entries to CDPATH, each separated by a colon, as shown in the following example:
one
Export CDPATH=.:~:/etc:/var
This technique is widely used in the following situations:
The database administrator (DBAs) of Oracle often needs to work under ORACLE's home directory ($ORACLE_HOME), so he can set the CDPATH variable to Oracle's directory.
Linux/Unix system administrators often need to work in the / etc directory and can set the CDPATH variable to / etc
Developers need to work in the project directory frequently, such as / home/projects. You can set the CDPATH variable to / home/projects.
Ordinary users often need to switch between subdirectories under their home directory, so they can set the CDPATH variable to ~ (this is the simple word for home directory in Linux/Unix).
Is it helpful for you to read the above content? If you want to know more about the relevant knowledge or read more related articles, please follow the industry information channel, thank you for your support.
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.