Well I am fairly new in Ubuntu world. New to Terminal too. Asfaik I can use the command cd -
to go back to the previous directory. Now lets say I am in a directory which is home/dir1/dir2/dir3/mydir
. Well now if I write cd -
terminal will send me to dir3
but if I want to go to dir2
and I write cd -
terminal takes me to mydir
again! And then if I write cd -
again terminal takes me to dir3
as expected. It means I fall into a loop. Can anyone tell me how can....
- Directly go to
dir2
frommydir
? - Browse
mydir
todir3
and thendir3
todir2
without falling into any loop?
Thanks for the answer.
If you want to go 1 level higher in directory tree, you do
So if you are at
home/dir1/dir2/dir3/mydir
this command will take you tohome/dir1/dir2/dir3
.Same command another time to
home/dir1/dir2
.If you want to go from
home/dir1/dir2/dir3/mydir
tohome/dir1/dir2
, you doThe command you tried
cd -
takes you to previous directory.