Please support VectorLinux!

Author Topic: How To List Whole Folder Structure - SOLVED  (Read 968 times)

Martin109

  • Vectorite
  • ***
  • Posts: 290
How To List Whole Folder Structure - SOLVED
« on: March 14, 2009, 01:54:47 pm »
How can I get a listing of the whole tree structure of my /hda3 partition, ie all my non-root directories and their interrelations?
« Last Edit: March 15, 2009, 11:41:49 am by Martin109 »
Compaq Armada E500, i686 Pentium III, 512Mb RAM, 3.2 Gb HDD, running Vector Linux 5.9 Standard

Fujitsu Lifebook, i686 Pentium M, 1.7 GHz, 1028Mb RAM, 40 Gb HDD, running Vector Linux 6.0 Standard

Compaq Evo, i686 Pentium M, 1.4 GHz, 512Mb RAM, 40 Gb HDD, running Vector Linux 6.0 Standard

newt

  • Vectorian
  • ****
  • Posts: 1132
Re: How To List Whole Folder Structure
« Reply #1 on: March 14, 2009, 02:49:15 pm »
Something like the following should produce what you want.

tree -d --device / | grep replace-with-correct-device-number

Unfortunately I cannot determine what exactly a "device number" is or how it can be explicitly determined.  I can see that on my system my / partition (hda1) is '770' and my /home partition (hda3) is '773'. So, if I wanted to list just the directory tree structure of my /home partition I would use:

tree -d -device / | grep 773

Or, if I wanted to list just my / partition tree structure I would use:

tree -d -device / | grep 770

The whole thing could be dumped to a text file like this:

tree -d -device / | grep 773 > name-of-file.txt

Hope this helps.  Hopefully someone will shed some light on the "device number" thing.

Martin109

  • Vectorite
  • ***
  • Posts: 290
Re: How To List Whole Folder Structure
« Reply #2 on: March 15, 2009, 04:31:03 am »
I can see that on my system my / partition (hda1) is '770' and my /home partition (hda3) is '773'. So, if I wanted to list just the directory tree structure of my /home partition I would use:

Could you say how you can see that your / partition is '770', for example.  What command did you use to find that out?
Compaq Armada E500, i686 Pentium III, 512Mb RAM, 3.2 Gb HDD, running Vector Linux 5.9 Standard

Fujitsu Lifebook, i686 Pentium M, 1.7 GHz, 1028Mb RAM, 40 Gb HDD, running Vector Linux 6.0 Standard

Compaq Evo, i686 Pentium M, 1.4 GHz, 512Mb RAM, 40 Gb HDD, running Vector Linux 6.0 Standard

newt

  • Vectorian
  • ****
  • Posts: 1132
Re: How To List Whole Folder Structure
« Reply #3 on: March 15, 2009, 09:09:38 am »
Running the command without grep will show the different device numbers:
tree -d -device /

If you know your /home is on a different partition then:
tree -d -device /home
should show the device number for that partition.

Martin109

  • Vectorite
  • ***
  • Posts: 290
Re: How To List Whole Folder Structure
« Reply #4 on: March 15, 2009, 11:36:53 am »
Thanks, newtor! :)
Compaq Armada E500, i686 Pentium III, 512Mb RAM, 3.2 Gb HDD, running Vector Linux 5.9 Standard

Fujitsu Lifebook, i686 Pentium M, 1.7 GHz, 1028Mb RAM, 40 Gb HDD, running Vector Linux 6.0 Standard

Compaq Evo, i686 Pentium M, 1.4 GHz, 512Mb RAM, 40 Gb HDD, running Vector Linux 6.0 Standard