🖥️pushd
➡️This is a command-line reference manual for commands and command combinations that you don’t use often enough to remember it. This cheatsheet explains the pushd command with important options and switches using examples.
2 minute read
▁ ▂ ▃ ▄ ꧁ 🔴☠ COMMANDLINE-KUNGFU WITH CHEATSHEETS ☠🔴꧂▅ ▃ ▂ ▁
# ██████╗ ██╗ ██╗███████╗██╗ ██╗██████╗
# ██╔══██╗██║ ██║██╔════╝██║ ██║██╔══██╗
# ██████╔╝██║ ██║███████╗███████║██║ ██║
# ██╔═══╝ ██║ ██║╚════██║██╔══██║██║ ██║
# ██║ ╚██████╔╝███████║██║ ██║██████╔╝
# ╚═╝ ╚═════╝ ╚══════╝╚═╝ ╚═╝╚═════╝
# Pushes your current directory to the top of a stack while changing to the specified directory
pushd <directory>
pushd and popd
# are also common programs you can use for moving around the filesystem. See 'help pushd' and 'help popd' for info.
# To return use popd
popd
# Come back quickly to the current directory after doing some temporary work somewhere else
pushd /some/where/else; work; cd /somewhere; work; cd /another/place; popd
# Explanation:
# pushd, popd and dirs are bash builtins, you can read about them with help dirs
# bash keeps a stack of "remembered" directories, and this stack can be manipulated with the pushd and popd builtins, and displayed with the dirs builtin
# pushd will put the current directory on top of the directory stack. So, if you need to change to a different directory temporarily and you know that eventually you will want to come back to where you are, it is better to change directory with pushd instead of cd. While working on the temporary task you can change directories with cd several times, and in the end when you want to come back to where you started from, you can simply do popd.
#==============================##==============================#
# CMD PUSHD #
#==============================##==============================#
Cheatsheets are an excellent complement to other information sources like Linux man-pages, Linux help, or How-To’s and tutorials, as they provide compact and easily accessible information. While man-pages and detailed tutorials often contain comprehensive explanations and extensive guides, cheatsheets summarize the most important options forthe command pushd in a clear format. This allows users to quickly access the needed information for pushd without having to sift through lengthy texts. Especially in stressful situations or for recurring tasks, cheatsheets for pushd are a valuable resource to work efficiently and purposefully.
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
█║▌│║█║▌★ KALI ★ PARROT ★ DEBIAN 🔴 PENTESTING ★ HACKING ★ █║▌│║█║▌
██╗ ██╗ ██████╗ ██████╗ ██╗ ██╗███████╗██████╗
████████╗██╔══██╗██╔═══██╗╚██╗██╔╝██╔════╝██╔══██╗
╚██╔═██╔╝██║ ██║██║ ██║ ╚███╔╝ █████╗ ██║ ██║
████████╗██║ ██║██║ ██║ ██╔██╗ ██╔══╝ ██║ ██║
╚██╔═██╔╝██████╔╝╚██████╔╝██╔╝ ██╗███████╗██████╔╝
╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝╚═════╝
█║▌│║█║▌ WITH COMMANDLINE-KUNGFU POWER █║▌│║█║▌
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.