LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 01-06-2005, 03:11 PM   #1
dr_zayus69
Member
 
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, 03:15 PM   #2
Andrew Benton
Senior Member
 
Registered: Aug 2003
Location: Birkenhead/Britain
Distribution: Linux From Scratch
Posts: 2,073

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

Original Poster
Rep: Reputation: 35
thanks
 
Old 01-06-2005, 03:36 PM   #4
itsjustme
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
/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.
 
  


Reply


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 07:00 PM
Meaning of Compression level 'dump' command dtournas Linux - General 3 12-31-2004 09:05 PM
change security level in command-line kantoboy Mandriva 3 08-31-2004 06:07 AM
How do you change INIT startup to level 3 (graphical) from command line? Fear58 Linux - Newbie 2 06-25-2004 08:15 PM
How to Change Mandrake Security Level in the command line miketheninja Linux - General 1 03-04-2004 04:45 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:52 AM.

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