Computing.Net > Forums > Unix > Sorting by file size

Computing.Net: Over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to sign up now, it's free!

Sorting by file size

Reply to Message Icon

Original Message
Name: UnixNewbie
Date: February 23, 2004 at 04:53:56 Pacific
Subject: Sorting by file size
OS: Win ME
CPU/Ram: 950 Mhz 128MB
Comment:

Hi there,
I was wondering if someone could help me out real quick. I am trying to display a list of the /etc directory and sort the output by size and place the smallest files on the bottom of the output.
However, I cannot seem to get it to work. Can anybody tell me the easiest way to do this?
Thanks,
UNIXnewbie



Report Offensive Message For Removal


Response Number 1
Name: Jim Boothe
Date: February 23, 2004 at 06:19:24 Pacific
Reply: (edit)

ls -l /etc | sort +4rn


Report Offensive Follow Up For Removal

Response Number 2
Name: Dlonra
Date: February 23, 2004 at 18:20:34 Pacific
Reply: (edit)

this works on linux
cd /etc
ls -lS $(find . -type f -maxdepth 1)


Report Offensive Follow Up For Removal







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Unix Forum Home








Do you have your own blog?

Yes
No
I did before
I will soon


View Results

Poll Finishes In 2 Days.
Discuss in The Lounge
Poll History




Data Recovery Software