LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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, 08:33 AM   #1
HalfMadDad
Member
 
Registered: Jun 2010
Location: Canada
Distribution: Slackware, systemd-garbage
Posts: 143

Rep: Reputation: 9
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, 08:39 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,629

Rep: Reputation: 7265Reputation: 7265Reputation: 7265Reputation: 7265Reputation: 7265Reputation: 7265Reputation: 7265Reputation: 7265Reputation: 7265Reputation: 7265Reputation: 7265
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, 08:47 AM   #3
HalfMadDad
Member
 
Registered: Jun 2010
Location: Canada
Distribution: Slackware, systemd-garbage
Posts: 143

Original Poster
Rep: Reputation: 9
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, 09:07 AM   #4
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
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, 09:21 AM   #5
HalfMadDad
Member
 
Registered: Jun 2010
Location: Canada
Distribution: Slackware, systemd-garbage
Posts: 143

Original Poster
Rep: Reputation: 9
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 08:00 AM
Convert directory structure from long file names in Linux to DOS 8.3 structure? manorina Linux - Software 5 09-12-2009 09:18 AM
Home Jail Folder Structure like Gobolinux Directory Structure luispt Linux - General 3 07-26-2008 06:46 PM
Understanding the directory structure subaruwrx Debian 5 07-12-2007 06:30 AM
understanding directory structure wincrk Linux - General 6 03-02-2003 07:11 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

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