🖥️cd
➡️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 cd command with important options and switches using examples.
2 minute read
▁ ▂ ▃ ▄ ꧁ 🔴☠ COMMANDLINE-KUNGFU WITH CHEATSHEETS ☠🔴꧂▅ ▃ ▂ ▁
# ██████╗██████╗
# ██╔════╝██╔══██╗
# ██║ ██║ ██║
# ██║ ██║ ██║
# ╚██████╗██████╔╝
# ╚═════╝╚═════╝
#==============================#
# CMD CD change Directory
#==============================##==============================#
cd .
# If you are in a directory that is removed and recreated (such as a symlinked current dir), this will put you in the new directory.
cd -
# Takes you back to the previous directory you were in. Good to know if you don not already.
cd
# (With no arguments) Takes you back to your home directory.
cd tmp/a/b/c && tar xvf ~/archive.tar
# Use && to run a second command if and only if a first command succeeds
cd /pub ; cd -
# Change to /pub and then change back to the dir you were in before.
cp !:3 !:2
# Copy the 3rd word from prev. command over 2nd word of the prev. command. e.g. If prev cmd was diff -Nup older newer then this would run cp newer older. Be careful though. Try it with cp !:3:p !:2 first to see what will happen before executing.
cd $(mktemp -d)
# get an instant temporary directory
# Access folder "-"
# If you try to access cd - you go to the last folder you were in.
cd -- -
# Access folder "-" -> If you try to access cd - you go to the last folder you were in.
cd -- -
#==============================##==============================#
# CMD CD change Directory
#==============================##==============================#
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 cd in a clear format. This allows users to quickly access the needed information for cd without having to sift through lengthy texts. Especially in stressful situations or for recurring tasks, cheatsheets for cd 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.