Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 11-17-2009, 04:07 AM   #1
Registered: Sep 2006
Location: Nagpur, Maharashtra, India
Distribution: Debian, Ubuntu, Redhat, Fedora, SLES, OpenSUSE, FreeBSD, Mac OS X
Posts: 221

Rep: Reputation: 31
Command to find largest file.

Hi All,

Is there a direct Linux command to find the largest file by checking recursively in all the directories.
Old 11-17-2009, 04:21 AM   #2
Senior Member
Registered: Dec 2003
Location: Trondheim, Norway
Distribution: Debian and Ubuntu
Posts: 1,379

Rep: Reputation: 404Reputation: 404Reputation: 404Reputation: 404Reputation: 404
I don't know of a direct command, but you can combine commands to do it:

find -type f -printf '%s %p\n' |sort -n |tail -n 1
Old 11-17-2009, 04:36 AM   #3
LQ Guru
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1296Reputation: 1296Reputation: 1296Reputation: 1296Reputation: 1296Reputation: 1296Reputation: 1296Reputation: 1296Reputation: 1296

As far as I know there is no direct command but this combination also works:
find / -type f -size +20000k -exec ls -lh {} \;
This one looks for files larger than 20Mb appr. and outputs them in a human readable format.

Kind regards,



Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
C++ find array index for largest number. joshp Programming 7 03-15-2009 10:56 AM
how do i find the largest file on machine amit_joshi Linux - Newbie 4 10-08-2007 07:09 PM
How to issue "ls" command start with the largest file size in a folder? fjkum Linux - Newbie 5 07-27-2006 03:28 AM
Find 100 largest files in folder tree tyreth Linux - General 2 02-07-2006 08:18 AM
Largest a tar file can be? mijohnst Linux - General 4 02-07-2006 08:14 AM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:46 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration