Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: View tree in Ubuntu 11.10

  1. #1
    Join Date
    Aug 2012
    Beans
    50

    View tree in Ubuntu 11.10

    Hello folks,

    I'am using ubuntu 11.10(CLI) and I need to get an overview of the directories in my system.

    Example /usr: rights = 775
    owner = root

    But I need it for every directory/file and doing this one by one will take me ages.

    Is there anything I can download from apt-get to simplify this process??

    Many thanks.

  2. #2
    Join Date
    Jul 2007
    Location
    Magic City of the Plains
    Beans
    Hidden!
    Distro
    Xubuntu Development Release

    Re: View tree in Ubuntu 11.10

    I ran
    Code:
    sudo -i
    
    cd /
    
    ll -R > text
    This took a couple minutes or so to run, and the final 'text' file was 81MB.

  3. #3

    Re: View tree in Ubuntu 11.10

    Quote Originally Posted by MocroNL View Post
    Hello folks,

    I'am using ubuntu 11.10(CLI) and I need to get an overview of the directories in my system.
    Code:
    tree /usr
    Perms and user:
    Code:
    # find `pwd` /usr -perm 755 -type d
    # find `pwd` /usr -user root
    I believe you mis-typed the 775 and that should be 755 for directories (hence the "-type d")

    Combining the two is outside my pay grade.
    Windows assumes the user is an idiot.
    Linux demands proof.

  4. #4
    Join Date
    Aug 2012
    Beans
    50

    Re: View tree in Ubuntu 11.10

    Thank you for the reply!

    @oldos2er
    I get too many unnecessary information with that command. The information I need are:

    Example
    /etc (rights)(owner)(group)

    But I need this information from EVERY directory in my linux system.

    @Habitual
    When I use the tree command I get a strange output. It looks like this:
    âââ www
    âââ html
    âÂ*Â* âââ dist
    âÂ*Â* âââ etc
    âÂ*Â* âââ images
    âÂ*Â* âÂ*Â* âââ dropline
    âÂ*Â* âÂ*Â* âââ nuovo
    âÂ*Â* âÂ*Â* âââ nuvola_1
    âÂ*Â* âÂ*Â* âââ nuvola_2
    âÂ*Â* âÂ*Â* âââ webset
    âÂ*Â* âââ include
    âÂ*Â* âÂ*Â* âââ classes
    âÂ*Â* âÂ*Â* âââ css
    âÂ*Â* âÂ*Â* âââ defines
    âÂ*Â* âÂ*Â* âââ functions
    âÂ*Â* âÂ*Â* âÂ*Â* âââ redbean
    âÂ*Â* âÂ*Â* âââ js
    âÂ*Â* âÂ*Â* âââ xml
    âÂ*Â* âÂ*Â* âââ language
    âÂ*Â* âÂ*Â* âââ DE
    âÂ*Â* âÂ*Â* âââ EN
    ???

    Is it even possible to get an output from ubuntu that gives you a list of ALL directories inside the machine + rights,user and group????


    Many thanks.

  5. #5
    Join Date
    Apr 2012
    Beans
    7,256

    Re: View tree in Ubuntu 11.10

    You could do something like

    Code:
     sudo find / -type d -exec stat -c '%N %U %a %G' '{}' \;
    Have a look at the stat man page and decide exactly which fields you want (%U, %a etc.)

    Code:
    man stat
    You will need to do it with sudo to list some dirs

  6. #6
    Join Date
    Aug 2012
    Beans
    50

    Re: View tree in Ubuntu 11.10

    Heey.

    Now I'am getting close! Thank you steeldriver.

    Just need to figure it out how to see output from directories only.

    Greets

  7. #7
    Join Date
    Apr 2012
    Beans
    7,256

    Re: View tree in Ubuntu 11.10

    The '-type d' should limit the find to directories only

    Or do you mean you want to limit it to certain directory levels? if so you can use 'maxdepth'

    Code:
    sudo find / -type d -maxdepth 3 -exec stat -c '%N %U %a %G' '{}' \;

  8. #8
    Join Date
    Aug 2012
    Beans
    50

    Re: View tree in Ubuntu 11.10

    Yes true. Did not pay attention.....

    Thanks again! And is it possible to put this output into a file?

    Greets.

  9. #9
    Join Date
    Apr 2012
    Beans
    7,256

    Re: View tree in Ubuntu 11.10

    yes of course - just use the shell redirect >

    Code:
     sudo find / -type d -exec stat -c '%N %U %a %G' '{}' \; > whatever.txt

  10. #10
    Join Date
    Aug 2012
    Beans
    50

    Re: View tree in Ubuntu 11.10

    Thank you steeldriver

    You have made my day

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •