I use pushd, popd and dirs quite a bit - and when I forget, I use 'cd -' What I really like about pushd is using it without any parameters. If you have two or more directories in the stack, pushd by itself toggles you between the two top ones in the stack - just like 'cd -'.
Curt On Oct 14, 11:30 am, "Andrew Farnsworth" <[EMAIL PROTECTED]> wrote: > Haven't seen on in a bit so thought I would post the following link: > > http://www.thegeekstuff.com/2008/10/6-awesome-linux-cd-command-hacks-... > > This article talks about several "hacks" to the cd command but it really > discusses current directory manipulation, not restricting itself to just the > cd command. > > I particularly like Hack #4 and #5 which I have extracted snippets of from > the article. I knew about pushd and popd but did not know about cd - which > is very useful. > > Hack #4: Use "cd -" to toggle between the last two directories > > You can toggle between the last two current directories using cd - as shown > below. > > Hack #5: Use dirs, pushd and popd to manipulate directory stack > > You can use directory stack to push directories into it and later pop > directory from the stack. Following three commands are used in this example. > > * dirs: Display the directory stack > * pushd: Push directory into the stack > * popd: Pop directory from the stack and cd to it > > MAIH... > > Andy --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "NLUG" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/nlug-talk?hl=en -~----------~----~----~----~------~----~------~--~---
