Jeff75

Well-Known Member
Apr 11, 2003
555
0
166
Can somebody tell me if there's a way to only show files/folders that are 1 MB or larger in a directory? For example, if I run "ls -lh" it will show the size of the files/folders in bytes, kilobytes, or megabytes. I'd like to just show the files/folders that are in megabytes.

cPanel.net Support Ticket Number:
 

Jemshi

Well-Known Member
Sep 11, 2003
208
0
166
India
you will have to find folders and files separately.

ls wont show the folder size.

something like this should do.

Files :

ls -Shls | grep "^\ *[0-9]*.[0-9]*M\ "

Folders :

find . -not -name . -type d -maxdepth 1 -exec du -sh {} \; | grep "^[0-9].*[0-9]*M"

Cheers

cPanel.net Support Ticket Number: