alias to go back to previous directory?


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers alias to go back to previous directory?
# 1  
Old 06-22-2011
alias to go back to previous directory?

Some time ago I was using a linux system and someone had set up and
alias called "back" that got me back to the directory I was last in, which
was very useful. I've now switched to using a mac, and don't have those aliases available. Can anyone tell me how I could make a an alias that
would do this for me? Thanks in advance.
# 2  
Old 06-22-2011
Code:
cd -

That's a "cd <space> minus sign"
This User Gave Thanks to jim mcnamara For This Post:
# 3  
Old 06-22-2011
Great--thank you! That's way easier than I had imagined.

Quote:
Originally Posted by jim mcnamara
Code:
cd -

That's a "cd <space> minus sign"
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Create a directory with previous date

Hi All, can any body tell me how to create a new directory with previous time stamp in HP-UX?. e.g i am creating a file liketouch -t 07022013 kkk -rw-r----- 1 feeds sys 0 Jul 2 20:13 kkksame how can i create a directory? please help me. Thanks & Regards, Krupa (4 Replies)
Discussion started by: krupasindhu18
4 Replies

2. UNIX for Dummies Questions & Answers

Move back to a directory

~/assign1b/assign1/york/> your current directory is york how do you go back to your home directory with using relative pathname? not using cd alone? :( (3 Replies)
Discussion started by: blackendstars
3 Replies

3. Shell Programming and Scripting

Define Alias for Changing Directory to Another One

Hello Friends is it possible to define an alias (say named as COMMAND) to pick a part of line and change my directory to picked. For example when I type COMMAND mfong@vhl.gov.nd/homefolder/hhk/ADS/ it would do cd /homefolder/hhk/ADS/ (1 Reply)
Discussion started by: rpf
1 Replies

4. Shell Programming and Scripting

alias to cd and ls a directory

I am trying to create an alias to cd to a directry and ls the directory I have changed to. I have the following code; alias cd= 'cd ; ls $@' This just cd to the directory and ls the current directory. Any suggestions? Thanks (10 Replies)
Discussion started by: cold_Que
10 Replies

5. Solaris

( VxVM ) How to add the removed disk back to previous disk group

Previously , i remove the disk by #vxdg -g testdg -k rmdisk testdg02 But i got error when i -k adddisk bash-2.03# vxdisk list DEVICE TYPE DISK GROUP STATUS c0t0d0s2 auto:none - - online invalid c0t1d0s2 auto:none ... (1 Reply)
Discussion started by: waibabe
1 Replies

6. Shell Programming and Scripting

Puzzling Problem: Going back to the previous directory

Hi, I am trying to figure out if there is a way to make linux take me back to the previous directory I was working in. For instance, I am in /home/username/directory1 Then if I cd into /home/username/directory1/temp1/temp2/temp3 I would like to immediately go back to the previous... (2 Replies)
Discussion started by: Legend986
2 Replies

7. Linux

how to recover from back up directory

Hey all, Is there any way out to get/restore the deleted file in Linux ? As we do have Recycle Bin in Windows OS. as i deleted some files.. it is available in .snapshot but its a large files.. i cont use "mv" command to copy back. it there any way .. such like in window we click restore... (1 Reply)
Discussion started by: mail2sant
1 Replies

8. Shell Programming and Scripting

want to create directory with the previous date

I need some help to complet the below script: DATE1=`date "+%d"` #DATE2=`expr $DATE1 - 1` #DATE3=$DATE2`date "+%m%y"` DATE4=`date "+%a"` if ; then DATE2=`expr $DATE1 - 3` else DATE2=`expr $DATE1 - 1` fi (7 Replies)
Discussion started by: sridhusha
7 Replies

9. UNIX for Dummies Questions & Answers

Creating alias for directory path

I am trying to create an alias for a frequently used directory path by using alias xyz="/proj/dir_name" and then trying to reach a sub-directoy by using cd xyz/abc but I get an error saying " No such file or directory " plz tell me wats wrong with this ... (3 Replies)
Discussion started by: jasjot31
3 Replies

10. UNIX for Dummies Questions & Answers

Help with find command on a shortcut directory(Alias)???

Hi All, I am trying to find some files on a directory( /usr/users/xyz/log) which is an alias to another directory(/spare/log). My find works fine on /spare/log but it doesnt return anything when i use it on /usr/users/xyz/log. Any Ideas on how to proceed. Thanks in advance. Swamy (2 Replies)
Discussion started by: swamy455
2 Replies
Login or Register to Ask a Question