number of files in linux filesystem?

Discussion in 'Site & Server Administration' started by postcd, Aug 21, 2014.

  1. #1
    Hello, is there anywere on the internet directory tree of a linux filesystem (debian, redhat..) with number of files in particular directories?

    I dont neeed a command to list this, as this takes ages on my overloaded server, i just wanted if anyone found/ counted this, i dont need total number, but to see number of files mainly in first level subdirectories, thx

    PS: inodes number can be number of total files and dirs on filesystem maybe:
    so if its correct, its like 481 million in my case
     
    postcd, Aug 21, 2014 IP
  2. JoshDylan

    JoshDylan Well-Known Member

    Messages:
    133
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    130
    #2
    I don't believe there is an actual reference chart on exactly how many files should be in each directory, but you could always use "ls | wc -l" to check it on an individual directory basis.
     
    JoshDylan, Aug 24, 2014 IP
  3. hosting_spec80

    hosting_spec80 Active Member

    Messages:
    118
    Likes Received:
    5
    Best Answers:
    1
    Trophy Points:
    63
    #3
    By means of the command
    sudo find . -xdev -type f | cut -d "/" -f 2 | sort | uniq -c | sort -n
    you will be able to locate the directory with the most files
     
    hosting_spec80, Aug 26, 2014 IP