![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to remove directory with subdirectories and files? | ppa108 | UNIX for Dummies Questions & Answers | 9 | 1 Week Ago 11:02 PM |
| list the files but exclude the files in subdirectories | shyjuezy | UNIX for Dummies Questions & Answers | 8 | 10-15-2008 10:42 AM |
| Find all files created by a specified user in a directory and its subdirectories | abhilashnair | UNIX for Dummies Questions & Answers | 5 | 06-12-2007 11:37 PM |
| find the 5o largest files in a directory | igidttam | Filesystems, Disks and Memory | 8 | 05-16-2007 10:20 AM |
| searching files through all subdirectories beneath the current directory | milagros | Shell Programming and Scripting | 5 | 05-15-2007 01:00 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
list largest files in a directory & its subdirectories
I need to find the largest files in a directory & it's subdirectories.
I'm not sure what options on ls -l will work to give me this. or is there another way to do this? Thanks, igidttam |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
For example, to show the 10 largest files under /somedir and it's subdirectories:
Code:
find /somedir -type f -print | xargs ls -l | sort -k5,5rn | head ZB |
|
#3
|
|||
|
|||
|
ZB
I'm getting an error. xargs| Child killed with signal 13. How would I get around this? Thakn You for your help! igidttam |
|
#4
|
|||
|
|||
|
I changed the code a little to this
find /cep -type f -print | ls -l | head It worked, but not sure I have all the files in the subdirectories. Can someone help me here? Thanks igidttam |
|
#5
|
|||
|
|||
|
if you know what files are supposed to be there and /cep is the directory off of the root directory / you want to search
Code:
find /cep -type f -print Code:
cd /home find . -type f -print | ls -l -s | sort -n | tail Code:
cd /cep |
|
#6
|
|||
|
|||
|
Thanks Jim! This works, but only gives me the largest files in that directory [in my example the /cep directory]. I'm also looking for the largest files within each of the subdirectories of that directory. For example, I want the 10 largest files of some directory and the 10 largest files of each subdirectory under that directory. How do I do that?
Thanks, igidttam |
|
#7
|
|||
|
|||
|
I go t it to work. I needed the ls -lR.
Thanks Jim |
|||
| Google The UNIX and Linux Forums |