Get size of all files in a folder

Posted on 2010-01-03
Last Modified: 2012-05-08
I have a folder with thousands of sub-folders within it and lots of files.

Is there anyway I can run a command at the SSH level to list all the files out along with their sizes and the path to the file? Even better write the results to a text file.
Question by:PeterErhard
    LVL 7

    Accepted Solution

    du -s *

    for more details check
    LVL 48

    Expert Comment

    ls -lR /folder >/tmp/results.txt


    find /folder -type f -ls >/tmp/results.txt

    LVL 48

    Expert Comment

    The accepted solution doesn't address your requirements.

    1.  It doesn't list files in sub-folders.
    2.  It will list files *and* directories
    3.  It doesn't write the output to a file.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    Have you ever been frustrated by having to click seven times in order to retrieve a small bit of information from the web, always the same seven clicks, scrolling down and down until you reach your target? When you know the benefits of the command l…
    The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
    how to add IIS SMTP to handle application/Scanner relays into office 365.
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…

    733 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    26 Experts available now in Live!

    Get 1:1 Help Now