this post was submitted on 01 Dec 2024
414 points (99.1% liked)

Bash

779 readers
1 users here now

Talk about the Bash Shell and Bash scripting

founded 4 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 24 points 1 month ago (3 children)

cd - goes back to the last directory you have been in

[–] [email protected] 6 points 1 month ago

pushd and popd are also pretty neat in that they allow you to change directories using a stack; particularly useful as part of that is that using pushd without any arguments will pop the directory on top of the stack and move you there, while putting your previous directory on top of the stack. When you're working across directories where you need to move around within each directory, it can be really handy.

[–] apex32 1 points 1 month ago

Nice!

Also cd without any parameters takes you to your home directory.

[–] EtherWhack 0 points 1 month ago (1 children)
[–] Passerby6497 1 points 1 month ago

2 dots goes up a level, 3 dots is a syntax error:

bash: cd: ...: No such file or directory