LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 05-24-2012, 09:33 AM   #1
HalfMadDad
Member
 
Registered: Jun 2010
Distribution: Centos
Posts: 76

Rep: Reputation: 1
Understanding directory structure


So I am playing around with gcc's -v switch to see what it is doing behind the scenes. I don't understand the directory structure it is emitting.

So for instance during one phase it might list an object file to be linked in like this:

/usr/lib/gcc/arm-linux-gnueabi/4.6/../../../../arm-linux-gnueabi/lib/../lib/someObject.o

If I copy this line(minus the object file), cd to it and pwd, I get this:
/usr/arm-linux-gnueabi/lib

nice and clean and readable. I assume I end up in a totally differnt directory due to symbolic links but Why is gcc showing a directory structure with all the /../ pieces in it?

Thanks for reading-Patrick
 
Old 05-24-2012, 09:39 AM   #2
pan64
Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian i686 (solaris)
Posts: 5,142

Rep: Reputation: 1364Reputation: 1364Reputation: 1364Reputation: 1364Reputation: 1364Reputation: 1364Reputation: 1364Reputation: 1364Reputation: 1364Reputation: 1364
this is how the path constructed. gcc will not take care about .. and other parts, will not simplify it, just prints it.
 
Old 05-24-2012, 09:47 AM   #3
HalfMadDad
Member
 
Registered: Jun 2010
Distribution: Centos
Posts: 76

Original Poster
Rep: Reputation: 1
Hi pan64

Could you tell me what the /../ parts are for? I don't understand them.

Thanks for answering my post
 
Old 05-24-2012, 10:07 AM   #4
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 729Reputation: 729Reputation: 729Reputation: 729Reputation: 729Reputation: 729Reputation: 729
for reasons sometimes known only to the developers, path descriptions can be quite convoluted....

first ".." means move up one level in the directory tree.

Suppose you are in /home/username/files/xyz/

enter "cd .." and you will be in /home/username/files/

Now, suppose you are in /home/username/files/xyz/ and you want to display a file (fred) that is up one level under files:
more ../fred
OR
more /home/username/files/xyz/../fred
OR
more /home/username/files/fred

Play with a while and it will start to make sense.
 
1 members found this post helpful.
Old 05-24-2012, 10:21 AM   #5
HalfMadDad
Member
 
Registered: Jun 2010
Distribution: Centos
Posts: 76

Original Poster
Rep: Reputation: 1
hi pixellany


Thanks for you help. I knew about the cd .. but didn't know people used it in directories paths.

Have a great day
 
  


Reply

Tags
directory


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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Understanding Linux Directory Structure LXer Syndicated Linux News 0 11-28-2011 09:00 AM
Convert directory structure from long file names in Linux to DOS 8.3 structure? manorina Linux - Software 5 09-12-2009 10:18 AM
Home Jail Folder Structure like Gobolinux Directory Structure luispt Linux - General 3 07-26-2008 07:46 PM
Understanding the directory structure subaruwrx Debian 5 07-12-2007 07:30 AM
understanding directory structure wincrk Linux - General 6 03-02-2003 08:11 AM


All times are GMT -5. The time now is 08:45 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration