How do I find the largest files?

Posted on 2006-04-07
Last Modified: 2013-12-16
I am using  vdir -RSh
but that is like off just a bit...

I want to know say the top by largest size 10 or 20 files in /usr

How do I do that?
I need to know fast.
Question by:jbrashear72
    LVL 51

    Expert Comment

    ls -lF /usr|grep -v '/$'|sort -r -k 5|head -10
    LVL 3

    Author Comment

    How can I show the top 10 largst files. not jusst thr directories?
    LVL 51

    Assisted Solution

    does my command show directories? I doubt .. but try this:
    ls -l /usr|grep -v ^d |sort -r -k 5|head -10
    LVL 43

    Expert Comment

    find /usr -type f -printf "%s %p\n" | sort -rn | head -n 10
    want strip sizes?
    find /usr -type f -printf "%s %p\n" | sort -rn | head -n 10 | cut -d' ' -f2

    Accepted Solution

    This is my method of fast findig place eaters

    cd /usr
    du -sk `ls`
    see top occupied directories

    then cd  into them
    and run
    du -sk `ls` more and more...

    Featured Post

    What Should I Do With This Threat Intelligence?

    Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

    Join & Write a Comment

    Currently, there is not an RPM package available under the RHEL/Fedora/CentOS distributions that gives you a quick and easy way to allow PHP to interface with Oracle. As a result, I have included a set of instructions on how to do this with minimal …
    Over the last ten+ years I have seen Linux configuration tools come and go. In the early days there was the tried-and-true, all-powerful linuxconf that many thought would remain the one and only Linux configuration tool until the end of times. Well,…
    Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
    Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…

    730 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

    18 Experts available now in Live!

    Get 1:1 Help Now