Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 01-06-2005, 04:11 PM   #1
Registered: Sep 2004
Location: western massachusetts
Distribution: fedora core 3, Suse 10
Posts: 877

Rep: Reputation: 35
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?
Old 01-06-2005, 04:15 PM   #2
Andrew Benton
Senior Member
Registered: Aug 2003
Location: Birkenhead/Britain
Distribution: Linux From Scratch
Posts: 2,073

Rep: Reputation: 64
cd ..
Old 01-06-2005, 04:25 PM   #3
Registered: Sep 2004
Location: western massachusetts
Distribution: fedora core 3, Suse 10
Posts: 877

Original Poster
Rep: Reputation: 35
Old 01-06-2005, 04:36 PM   #4
Senior Member
Registered: Mar 2003
Location: Earth
Distribution: Slackware, Ubuntu, Smoothwall
Posts: 1,571

Rep: Reputation: 47
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
$ 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.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I go to the windows screen from the command line on suse, on run level 3? abefroman SUSE / openSUSE 1 05-08-2005 08:00 PM
Meaning of Compression level 'dump' command dtournas Linux - General 3 12-31-2004 10:05 PM
change security level in command-line kantoboy Mandriva 3 08-31-2004 07:07 AM
How do you change INIT startup to level 3 (graphical) from command line? Fear58 Linux - Newbie 2 06-25-2004 09:15 PM
How to Change Mandrake Security Level in the command line miketheninja Linux - General 1 03-04-2004 05:45 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:58 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration