Re:Some powerful commands for Linux
by RyanMcGreal on Saturday November 27, 2010 @02:28PM
(#1945650)
It's really handy if you need to jump back and forth between two directories with diverse paths.
[ Parent
| on HN ]
For that I usually use pushd.
[chronomex@gir ~]$ mkdir test1 test2
[chronomex@gir ~]$ cd test2
[chronomex@gir ~/test2]$ pwd
/home/chronomex/test2
[chronomex@gir ~/test2]$ pushd ../test1
~/test1 ~/test2
[chronomex@gir ~/test1]$ pwd
/home/chronomex/test1
[chronomex@gir ~/test1]$ pushd
~/test2 ~/test1
[chronomex@gir ~/test2]$ pwd
/home/chronomex/test2
[chronomex@gir ~/test2]$On older systems you had to do a fairly complicated set up for pushd/popd yourself. I did once in along 1998 or so, but never bothered again, since the great majority of the time "cd -" was good enough.