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 > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly shows you "what is the use of the pushd command in Linux", the content is easy to understand, clear, hope to help you solve your doubts, the following let the editor lead you to study and learn "what is the use of pushd command in Linux" this article.
Linux common commands pushd commands add directories to the command stack. If the directive does not specify a directory name, the current working directory is placed at the top of the directory stack.
Pushd adds directories to the top of the directory stack.
Summary pushd [- n] [+ N |-N | dir] the main purpose is to add a directory to the top of the directory stack and switch the current working directory to that directory.
Rotate the directory stack so that the new top of the stack becomes the current working directory.
When there are no parameters, swap the first two directories of the directory stack.
Option-n suppresses changes to the current working directory caused by adding directories. Parameter + N (optional): in the list displayed by executing the dirs command without arguments, the nth directory from the left will be the top of the stack, and the one in front of it will be moved to the bottom. (count from 0)
-N (optional): in the list displayed by executing the dirs command without arguments, the nth directory from the right will be at the top of the stack, and the one in front of it will be moved to the bottom. (count from 0)
Dir (optional): the directory to push.
The return value returns success unless an illegal option is provided or an error occurs in the execution.
Example # adds a directory to the stack, changing the current working directory. [user2@pc ~] $dirs ~ [user2@pc ~] $pushd ~ / Desktop ~ / Desktop ~ [user2@pc Desktop] $# add a directory to the stack, and the current working directory remains unchanged. [user2@pc ~] $dirs ~ [user2@pc ~] $pushd-n ~ / Desktop ~ / Desktop [user2@pc ~] $pushd-n ~ / Pictures ~ / Pictures ~ / Desktop # adjust the order. [user2@pc ~] $pushd + 1 ~ / Pictures ~ / Desktop ~ [user2@pc ~] $pushd-1 ~ / Desktop ~ ~ / Pictures [user2@pc ~] $pushd ~ / Desktop ~ / Pictures Note the directory stack command of bash includes dirs popd pushd.
The current directory is always at the top of the directory stack.
This command is a bash built-in command. For help, please see the help command.
Refer to the behavior of the linked popd, pushd command'- n 'option
The above is all the content of the article "what is the use of pushd commands in Linux". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
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.