[Last Call] Learn how to a build a cloud-first strategyRegister Now


How do I find the largest files?

Posted on 2006-04-07
Medium Priority
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

ID: 16402266
ls -lF /usr|grep -v '/$'|sort -r -k 5|head -10

Author Comment

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

Assisted Solution

ahoffmann earned 1000 total points
ID: 16402517
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

ID: 16402705
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

dub082097 earned 1000 total points
ID: 16504620
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

Restore individual SQL databases with ease

Veeam Explorer for Microsoft SQL Server delivers an easy-to-use, wizard-driven interface for restoring your databases from a backup. No expert SQL background required. Web interface provides a complete view of all available SQL databases to simplify the recovery of lost database

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you have a server on collocation with the super-fast CPU, that doesn't mean that you get it running at full power. Here is a preamble. When doing inventory of Linux servers, that I'm administering, I've found that some of them are running on l…
It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Suggested Courses
Course of the Month17 days, 16 hours left to enroll

830 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