LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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 10-17-2003, 05:46 PM   #1
gag
LQ Newbie
 
Registered: Oct 2003
Location: Colchester
Distribution: Red Hat 9
Posts: 16

Rep: Reputation: 0
dot and dot dot


Sorry if you get these questions regularly, but this is such a fast moving site that I can't keep track of all the action!!

Could anyone tell me the purpose of the "." and ".." special registers?

Thanks
 
Old 10-17-2003, 05:51 PM   #2
speter
Member
 
Registered: Sep 2003
Location: Edison, NJ
Distribution: Fedora, Mac OS X
Posts: 313

Rep: Reputation: 30
. is your current directory. For security, this is usually not on your path, so in order to run something from here, you need to type ./<file>

.. is the parent of your current directory. To move up, you type "cd .."

Basically, they make things much faster to type.

Steve
 
Old 10-17-2003, 05:52 PM   #3
jharris
Senior Member
 
Registered: May 2001
Location: Bristol, UK
Distribution: Slackware, Fedora, RHES
Posts: 2,243

Rep: Reputation: 47
You refering to the "." and ".." that are shown if you do an ls -la yeah? If so its simply that "." represent your current directory, and ".." is the parent of your current directory. So say you did[code]cd /home/username/publc_html[/b]Then "." would be /home/username/public_html and ".." would be /home/username, and "../.." would be /home.

The only place this gets a little odd in the root directory ( / ) as the parent of / is / - so "." and ".." are in fact the same.

Does that make sense?

cheers

Jamie...

Last edited by jharris; 10-17-2003 at 05:54 PM.
 
Old 10-17-2003, 05:53 PM   #4
gag
LQ Newbie
 
Registered: Oct 2003
Location: Colchester
Distribution: Red Hat 9
Posts: 16

Original Poster
Rep: Reputation: 0
Cheers
 
Old 10-17-2003, 05:57 PM   #5
hussar
Member
 
Registered: Oct 2003
Location: Heidelberg, Germany
Distribution: Slackware 11.0; Kubuntu 6.06; OpenBSD 4.0; OS X 10.4.10
Posts: 345

Rep: Reputation: 30
This is actually a great question, because it helps to illustrate a basic point of the *nix file structure.

"." referes to the current directory. This is important, for example, when you are compiling software. Very often there is a configure script to configure how the software should be built. You would enter the command './configure' from within the source directory of the new software, and the "." indicates to the OS that the particular configure script you want to use is in the current directory.

".." points to the directory directly above working directory you are in at the time. So, if you drop down into your bin directory to edit one of your scripts and then want to go back to the next directory higher, you can type the command 'cd ..' to go there.

HTH,
 
  


Reply



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
dot.flp workaround rhoyerboat Linux - Software 2 02-16-2005 07:35 PM
Dot Net Program? Kikketer Linux - Software 6 12-07-2004 08:41 PM
useradd not accepting dot so i am not able to use dot in mail id hanu_raob Linux - General 5 05-13-2004 07:04 AM
MIKEROWSOFT dot COM joesbox General 31 01-23-2004 05:16 PM
What is dot vrdprasad Linux - General 1 11-08-2003 05:57 AM

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

All times are GMT -5. The time now is 05:51 PM.

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