Did you know LQ has a Linux Hardware Compatibility List?
Go Back > Forums > Linux Forums > Linux - General
User Name
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.


Search this Thread
Old 05-24-2012, 08:33 AM   #1
Registered: Jun 2010
Distribution: Centos
Posts: 74

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:


If I copy this line(minus the object file), cd to it and pwd, I get this:

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
Senior Member
Registered: Mar 2012
Location: Hungary
Distribution: debian i686 (solaris)
Posts: 4,838

Rep: Reputation: 1287Reputation: 1287Reputation: 1287Reputation: 1287Reputation: 1287Reputation: 1287Reputation: 1287Reputation: 1287Reputation: 1287
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
Registered: Jun 2010
Distribution: Centos
Posts: 74

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, 09:07 AM   #4
LQ Veteran
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728
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
more /home/username/files/xyz/../fred
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
Registered: Jun 2010
Distribution: Centos
Posts: 74

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



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

All times are GMT -5. The time now is 07:25 PM.

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