Possible Duplicate:
Unix command to list all directories larger than 10mb
How to find the largest file in a directory?
How to find the largest file in a directory? | ||||
feedback
|
This question came from our site for professional and enthusiast programmers.
This question covers exactly the same ground as earlier questions on this topic; its answers may be merged with another identical question. See the FAQ for guidance on how to improve it.
|
The best way is to use
To get the biggest one, use
| |||
|
feedback
|
|
Assuming you're in the directory already:
| |||||
feedback
|
|
You can use the find command to do this work. Let DIR is the directory in which you want to find the largest file, run the following command:
This will list the files whose size greater than 5MB. You can adjust this value (ie. option size) according to your need. If you want to check the files under this DIR only, use the below one. You can adjust the maxdepth value to check in subfolder.
| ||||
|
feedback
|