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 02-12-2019, 09:46 AM   #1
yangou
Member
 
Registered: Feb 2010
Location: London
Distribution: Fedora 25
Posts: 39

Rep: Reputation: 2
syntax


Hello

Can someone please tell me what ../../ mean below:

Code:
ln -s ../../images /tftpboot/proxy/bios/images
Many thanks
 
Old 02-12-2019, 10:07 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,804

Rep: Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306
http://wiki.linuxquestions.org/wiki/Parent_directory
https://en.wikipedia.org/wiki/Path_(computing)
 
Old 02-12-2019, 10:11 AM   #3
yangou
Member
 
Registered: Feb 2010
Location: London
Distribution: Fedora 25
Posts: 39

Original Poster
Rep: Reputation: 2
very informative
 
Old 02-12-2019, 10:29 AM   #4
l0f4r0
Member
 
Registered: Jul 2018
Location: Paris
Distribution: Debian
Posts: 900

Rep: Reputation: 290Reputation: 290Reputation: 290
Can you please mark your thread as [SOLVED] (see HOWTO in my sig) if you have no further question on this topic anymore?
 
Old 02-12-2019, 10:32 AM   #5
yangou
Member
 
Registered: Feb 2010
Location: London
Distribution: Fedora 25
Posts: 39

Original Poster
Rep: Reputation: 2
I was hoping someone could explain to me the ../../ bit

I understand that

/ is the root directory;
./ is the current directory;
../ is the parent of the current directory.

Does that mean ../../ is the same as /?

Thank you
 
Old 02-12-2019, 10:53 AM   #6
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 21 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925
Quote:
Originally Posted by yangou View Post
I was hoping someone could explain to me the ../../ bit

I understand that

/ is the root directory;
./ is the current directory;
../ is the parent of the current directory.

Does that mean ../../ is the same as /?

Thank you
It's the parent of the parent directory, so it's the grandparent directory of the current directory, i.e. 2 directories upwards towards the root.

Assuming of course that there *are* two directory levels in the structure above the current directory (../ when you are already at root leaves you still at root).

Edit: To answer your question, ../../ only works out to be the same as / if you start at root or a maximum of 2 directory levels beneath it.

Last edited by hydrurga; 02-12-2019 at 10:54 AM.
 
1 members found this post helpful.
Old 02-12-2019, 03:32 PM   #7
ehartman
Senior Member
 
Registered: Jul 2007
Location: Delft, The Netherlands
Distribution: Slackware
Posts: 1,674

Rep: Reputation: 888Reputation: 888Reputation: 888Reputation: 888Reputation: 888Reputation: 888Reputation: 888
Quote:
Originally Posted by hydrurga View Post
It's the parent of the parent directory, so it's the grandparent directory of the current directory, i.e. 2 directories upwards towards the root.
In symbolical links I sometimes go upwards even more then 2 levels, so
../../../<some_path>
as to make that link relative to the directory it's IN instead of absolute (that is: starting with a /). This is to assure that the link still works, even when the whole tree is relocated (mv'd) to another place, which may be higher OR lower in the hierarchy.
 
Old 02-13-2019, 03:44 AM   #8
yangou
Member
 
Registered: Feb 2010
Location: London
Distribution: Fedora 25
Posts: 39

Original Poster
Rep: Reputation: 2
Quote:
Originally Posted by hydrurga View Post
It's the parent of the parent directory, so it's the grandparent directory of the current directory, i.e. 2 directories upwards towards the root.

Assuming of course that there *are* two directory levels in the structure above the current directory (../ when you are already at root leaves you still at root).

Edit: To answer your question, ../../ only works out to be the same as / if you start at root or a maximum of 2 directory levels beneath it.
Thank you hydrurga I got it now.
 
Old 02-13-2019, 03:44 AM   #9
yangou
Member
 
Registered: Feb 2010
Location: London
Distribution: Fedora 25
Posts: 39

Original Poster
Rep: Reputation: 2
Quote:
Originally Posted by ehartman View Post
In symbolical links I sometimes go upwards even more then 2 levels, so
../../../<some_path>
as to make that link relative to the directory it's IN instead of absolute (that is: starting with a /). This is to assure that the link still works, even when the whole tree is relocated (mv'd) to another place, which may be higher OR lower in the hierarchy.
Thank you ehartman
 
Old 02-13-2019, 04:27 AM   #10
l0f4r0
Member
 
Registered: Jul 2018
Location: Paris
Distribution: Debian
Posts: 900

Rep: Reputation: 290Reputation: 290Reputation: 290
Quote:
Originally Posted by yangou View Post
I was hoping someone could explain to me the ../../ bit
Oups...sorry, I thought you already had the material requested to answer your question.
I hope that matter is clearer for you now
 
Old 02-13-2019, 10:50 AM   #11
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,883
Blog Entries: 13

Rep: Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930Reputation: 4930
Quote:
Originally Posted by yangou View Post
I was hoping someone could explain to me the ../../ bit
Glad you feel you understand it. Just still wish to chime in.


To me it means "back two"
If you have ../../../ it means "back three"


Obviously starting with ../, that means "back one" and thus as you repeat, it just adds more to how far you are going back.


I would have to say that specifying a very long string like that becomes tedious and thus for command line, I'd make a decision to start back at some origin, like my home, or the root path, and then build up from there, also relying on tab completion of trings. In a script, I'd probably set a variable to define an origin directory. Like what is done in makefiles.
 
  


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
httpd: Syntax error on line 210 of /etc/httpd/conf/httpd.conf: Syntax error on line 6 iswarya Linux - Newbie 1 01-25-2012 01:28 PM
[python] syntax Error : invalid syntax Python_user Programming 2 09-06-2009 12:52 PM
[SOLVED] "Error: syntax before '@' token and Error: syntax at 'OTHER' token" bullrider Programming 2 07-27-2009 08:00 AM
Starting httpd: httpd: Syntax error on line 209 of /etc/httpd/conf/httpd.conf: Syntax sethukpathi Linux - Networking 6 04-12-2008 11:26 AM
C++ syntax error before :: token HELP, i cant find the syntax error :( qwijibow Programming 2 12-14-2004 06:09 PM

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

All times are GMT -5. The time now is 08: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