[raspberry-vi] Re: Did you know...?

  • From: Tim Chase <raspberry-vi@xxxxxxxxxxxxxxxxx>
  • To: raspberry-vi@xxxxxxxxxxxxx
  • Date: Mon, 15 Aug 2016 20:27:32 -0500

On August  5, 2016, Mike Ray wrote:

If you type 'cd -' at the command line it takes you back to the last
directory you were in.

And similarly, just like "~" means your home directory, "~-" will
expand to the previous directory you were in.  So the following works
nicely:

  $ cd /media/usb1/podcasts
  $ ls # look around, clean out old podcasts I've listened to
  $ cd ~/Music/podcasts
  $ cp *.mp3 ~-

That last "cp" command will copy all the MP3 files from the current
directory ("~/Music/podcasts") to the previous directory you were in
("/media/usb1/podcasts").

I use this pretty regularly and it saves typing out the full path
multiple times.

-tim



=========================================================== 
The raspberry-vi mailing list 
Archives: //www.freelists.org/archives/raspberry-vi
Administrative contact: <mike.ray@xxxxxxxxxxxxxx>
-----------------------------------------------------------
Raspberry Pi and the Raspberry Pi logo are trademarks of the Raspberry Pi 
Foundation.

This list is not affiliated to the Raspberry Pi Foundation and the views and 
attitudes expressed by the subscribers to this list do not reflect those of the 
Foundation.

Mike Ray, list creator, January 2013

Other related posts: