command to go up a level in the shell
is there a command to travel up a directory in the terminal? like if i was in /home/x/y could i use a command to go back to x?
|
Code:
cd .. |
thanks
|
Fun with dots.
Fun with dots.
In addition to the answer from Andrew Benton, . is the current directory .. is the parent directory of the current directory. If you are in say, /home/drzayus, and want to copy a file there, say /var/log/somelog.log, you could: $ cd $ pwd /home/drzayus $ cp /var/log/somelog.log . Then you would have a copy of that log in your home directory. Also, then, I suppose you could run: $ cp /var/log/somelog.log .. which would copy the file to drzayus' parent directory, /home. (I'm not currently on a linux machine to be able to test that second example , but it should work.) The . and .. can come in handy. |
All times are GMT -5. The time now is 08:32 PM. |