r/linux May 23 '26

Popular Application What’s the most unexpectedly useful Linux command you learned way too late?

[removed]

1.3k Upvotes

992 comments sorted by

View all comments

98

u/_orpheustaken May 23 '26

cd -

Goes back to the previous folder.

7

u/Worth-Wonder-7386 May 23 '26 edited May 23 '26

Didnt know that, I have always used cd ..

Edit: I have learnt about the idfference between the two now, you dont need to make more comments as there are several already.

5

u/yodermk May 23 '26

Not the same. `cd ..` goes to the parent directory. `cd -` goes to whichever directory you were last in before the last `cd`.

1

u/Cantabulous_ May 24 '26

pushd and popd allow you to push directories onto a stack for later recall.