Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 10-08-2007, 08:51 AM   #1
LQ Newbie
Registered: Oct 2007
Location: Mumbai
Distribution: Fedora 6
Posts: 2

Rep: Reputation: 0
Smile how do i find the largest file on machine


How can I find the largest file on the machine.
Please suggest me different options to do this.
Have a nice day !

Old 10-08-2007, 09:05 AM   #2
LQ Veteran
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405

This does look like homework...... Ok, without giving the complete answer, this should get you going.

Take a look at the following commands:
- du
- ls
- find (with sort)

Hope this helps.
Old 10-08-2007, 10:18 AM   #3
Senior Member
Registered: Oct 2003
Location: UK
Distribution: Kubuntu 12.10 (using awesome wm though)
Posts: 3,530

Rep: Reputation: 65
One hint - searching the whole filesystem on Unix-like OSes takes quite a long time. You should try to eliminate any parts of the filesystem which you do not wish to search first, and try to avoid multiple scans.
Old 10-08-2007, 04:45 PM   #4
Registered: Jul 2003
Location: Pennsylvainia
Distribution: Slackware / Debian / *Ubuntu / Opensuse / Solaris uname: Brian Cooney
Posts: 503

Rep: Reputation: 30
Another hint: If you find yourself searching the filesystem often, the find command can be worth setting up
Old 10-08-2007, 08:09 PM   #5
LQ Guru
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,339

Rep: Reputation: 2745Reputation: 2745Reputation: 2745Reputation: 2745Reputation: 2745Reputation: 2745Reputation: 2745Reputation: 2745Reputation: 2745Reputation: 2745Reputation: 2745
Actually, the 'find' cmd is std Unix ie it's always there. Perhaps you mean 'locate', which requires you to run a script regularly to keep it's db updated.


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
scp: copy a file from local machine to remote machine seran Linux - Newbie 8 10-30-2007 01:23 PM
How to issue "ls" command start with the largest file size in a folder? fjkum Linux - Newbie 5 07-27-2006 04:28 AM
Find 100 largest files in folder tree tyreth Linux - General 2 02-07-2006 09:18 AM
Largest a tar file can be? mijohnst Linux - General 4 02-07-2006 09:14 AM
bash scripting - largest # file extension brian0918 Programming 3 06-16-2003 01:06 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:17 PM.

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