Go back two directories

CU

Platinum Member
Aug 14, 2000
2,415
51
91
I just found out you can go back two directories in bash by typing "...". Seems like a strange command. Why have a command that goes back two directories, why not something like cd .. -n when n is the number of directories to go back.
 

CU

Platinum Member
Aug 14, 2000
2,415
51
91
Then why have ... as a command. I tried to google ..., but that is rather hard.
 

Aluvus

Platinum Member
Apr 27, 2006
2,913
1
0
Not recognized by bash (or as an argument to cd) on Ubuntu 9.04.

I would expect this to go up the directory tree, not back, similar to 'cd ..'.

As for why you would want something like this as opposed to a more cumbersome syntax that works for an arbitrary number of directories, the answer would seem pretty simple. You often want to go up one or two directories (and therefore want a simple command to do so), but rarely or never want to go up, say, 15. When jumping way up the directory tree, I just enter a path rather than construct some 'cd ../../../../../../../../../' monstrosity and hope I counted correctly.
 

CU

Platinum Member
Aug 14, 2000
2,415
51
91
... is not an argument to cd. It is just a command. This works on SLED 10 and 11. man ... returns nothing for it though.
 

Aluvus

Platinum Member
Apr 27, 2006
2,913
1
0
... is not an argument to cd. It is just a command. This works on SLED 10 and 11. man ... returns nothing for it though.

Not a command supported by my version of bash, as stated.

If it's a bash built-in, you'll need to look for it in man bash.
 

Vadatajs

Diamond Member
Aug 28, 2001
3,475
0
0
Not a command supported by my version of bash, as stated.

If it's a bash built-in, you'll need to look for it in man bash.

It's an alias. SLES and openSUSE set it up by default (in /etc/bash.bashrc).