-
Mac Lover
Sorting files in UNIX
I was reading this other thread and I got curious... is there a way for me to list files in UNIX and sort them by file size? I could think of ways of doing it in SQL, but not in UNIX (my 'UNIX skills' suck eh.) If ever there is a way to do this, could how do I include hidden files? And maybe display the 10 largest files in my hard drive, including hidden files?
Thanks!
-
06-03-2006 01:14 PM # ADS
Google Adsense
-
Mac Fanatic
Re: Sorting files in UNIX
Man "find", "ls" and "sort".
In particular, here's a quick and dirty way to do it (WARNING: WILL TAKE FOREVER!):
find / -type f -exec ls -l {} \; | sort -n +4
Add "sudo" to include all files regardless of ownership or permissions.
[ "Green Stabofen" avatar by Jesus Pernas ]
Bookmarks