|
|||||||
| Forums | Search Forums | Register | Forum Rules | Man Pages | Albums | FAQ | Members | Calendar | 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 Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Sorting ls by filesize
I saw some stuff in the search results on this - but nothing specific.....
I have a significant number of files (c. 300) which are output from a large process that I run. These are compared with a 'baselined' set of files - so I can quickly see if there are differences based on the sizes of the files. I want to sort the directory into filesize...and not by number of lines. I need byte size to confirm differences. I've thought about awk, wc -c, I've looked at sort -n ....and I've looked at the ls options...but I cant seem to get a combination to work for me. ideas? And Yeah I realise I could cut the filesize from the ls and sort by that....but there must be a simpler way.... (Oh and I work with SunOS 5.6 and typically use a bash shell). |
| Sponsored Links | ||
|
|
#2
|
|||
|
|||
|
try:
ls -al | sort -rn +4 this does a reverse numerical sort by file size. hope this helps. |
| The Following User Says Thank You to manderson19 For This Useful Post: | ||
Kumarvijay (05-19-2010) | ||
| Sponsored Links | ||
|
|
#3
|
|||
|
|||
|
Spot on - thanks.
|
| Sponsored Links | ||
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| if condition for filesize | rahulbahulekar | Shell Programming and Scripting | 7 | 10-13-2010 08:58 AM |
| getting filesize | pppswing | Shell Programming and Scripting | 6 | 06-30-2008 08:22 AM |
| filesize | infyanurag | Shell Programming and Scripting | 3 | 05-15-2008 05:00 AM |
| FileSize ??? | Cameron | Shell Programming and Scripting | 3 | 05-28-2002 10:34 PM |
| filesize | jmg5 | Shell Programming and Scripting | 2 | 02-13-2002 06:51 AM |
|
|