Friday, February 7, 2014

keeping your place in the unix shell

Last year I wrote about some OSX Terminal tips. One was putting the full path in the bash prompt... besides my personal preference for seeing the whole thing, it means if I scroll back up in the window, I can always get back to that location via copy and paste.

There's another older trick for keeping your place when navigating folders via the command line- instead of using "cd NEWLOCATION", try using "pushd NEWLOCATION". This puts a virtual bookmark where you were before the directory change. (Actually more akin to sticking your thumb at the location, since it's pretty ephemeral.) Use "popd" to get back to that spot. As an added bonus, it exercises thinking about stack notation.

Also, I just yesterday noticed that OSX's filesystem is a bit case-insensitive, despite being case-preserving. I'm not sure how I feel about that...

1 comment:

  1. There's also "cd -" to go back to the previous working dir

    ReplyDelete