Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


how to find largest file?

Answers were Sorted based on User's Feedback



how to find largest file?..

Answer / yankee

In the Directry Give....

ls -ls|sort -nr|head -1

that gives the largest file statistics...

Is This Answer Correct ?    50 Yes 6 No

how to find largest file?..

Answer / prasanta das

ls -l | sort +4 -nr | head -1

Is This Answer Correct ?    9 Yes 5 No

how to find largest file?..

Answer / viswa

To find largest file in a particular dir:-
ls -lS //Gives the asceding order of files in terms of size.

ls -lS | head //Give the top 10 largest files in a dir

Is This Answer Correct ?    5 Yes 1 No

how to find largest file?..

Answer / phani

Eg:- we need to find /tmp filesystme large files , this
command will give all large files::
find /tmp -size +200 -exec -ls -s {} \; |sort -nr |more
=============
(root): ls -lstr|head -1
total 112
==============
: ls -l | sort +4 -nr | head -1
dr-xr-xr-x 11 root bin 8192 Oct 4 2007
SUNWexplo
===========
: ls -ls|sort -nr|head -1
16 drwxr-xr-x 25 appw app 8192 Aug 4 14:45 appw2
==============
: du -a /var | sort -n -r | head -n 10
6054872 /var
2150598 /var/sadm
2108022 /var/sadm/pkg
2077238 /var/crash
2077220 /var/crash/cmfciohqapp01
2072560 /var/crash/cmfciohqapp01/vmcore.0
1182398 /var/tmp
282530 /var/sadm/pkg/VRTSvxvm
282454 /var/sadm/pkg/VRTSvxvm/save
276332 /var/tmp/J2SE_Solaris_10_Recommended
===================

Is This Answer Correct ?    3 Yes 0 No

how to find largest file?..

Answer / madhusudan choudhary

We can do this by

ls -lrt | sort +4nr -5 | head -1

or

du -s . | sort -nr | head -1

Is This Answer Correct ?    2 Yes 1 No

how to find largest file?..

Answer / ramesh

$ls -l|tr -s " "|sort -t " " -f +4,-5|tail -1

Is This Answer Correct ?    1 Yes 1 No

how to find largest file?..

Answer / suvarna

du -a /var | sort -n -r | head -1

Is This Answer Correct ?    0 Yes 0 No

how to find largest file?..

Answer / hari

$file [a-z]

Is This Answer Correct ?    0 Yes 0 No

how to find largest file?..

Answer / souravpoddar

There is no simple command available to find out the largest files/directories on a Linux/UNIX/BSD filesystem. However, combination of following three commands (using pipes) you can easily find out list of largest files:

du command : Estimate file space usage.
sort command : Sort lines of text files or given input data.
head command : Output the first part of files i.e. to display first 10 largest file.
find command : Search file.
Type the following command at the shell prompt to find out top 10 largest file/directories:
# du -a /var | sort -n -r | head -n 10

Sample outputs:

1008372 /var
313236 /var/www
253964 /var/log
192544 /var/lib
152628 /var/spool
152508 /var/spool/squid
136524 /var/spool/squid/00
95736 /var/log/mrtg.log
74688 /var/log/squid
62544 /var/cache

Is This Answer Correct ?    0 Yes 0 No

how to find largest file?..

Answer / mayank

du / -ah |sort -nr |head -n 10
it will show the first 10 largest file in the system

Is This Answer Correct ?    0 Yes 1 No

Post New Answer

More Unix Commands Interview Questions

when we installing aix os the ssh installed default?

2 Answers  


What is the comma to show the space allocation of files?

0 Answers  


Can a process kill itself in UNIX/or in its various versions?

2 Answers  


How to remove a crontab file?

2 Answers  


what do you understand by 'building block primitive'?

0 Answers   Infosys,


distinguish between paging and swapping?

3 Answers   Infosys,


what are the different commands used to view the contents of a file?

5 Answers  


What Command will remove a Directory in UNIX?

8 Answers   IBM,


Sorry to all Technical person for mistake of Question. Now i am post currect question Why copied file permission is changed in destination. When i give all permission i.e 777 to file and copy that to other location in destination the permission is 755. But if give permission 555 in destination that file permission is 555 and if give permission 444 to file after copy in destination the file permission is 444. These all are happening in normal user. How the umask value is calculate here really i am not understand. Please write the proper answer. Thanks in Advance

3 Answers   TCS,


What is the unix command to confirm a remote host is alive or not?

0 Answers  


Why is grep called grep?

0 Answers  


How to rename files and folders?

7 Answers   IBM, Oracle,


Categories