Hi,
Is there anyway to list a set of files in a directory whose size is
greater than some value?
Or to display in sorted order by size? Any UNIX command?
Nithya
|
|
0
|
|
|
|
Reply
|
vnithya (2)
|
9/24/2004 5:12:25 AM |
|
"Nithya Venkatachalam" <vnithya@gmail.com> writes:
> Hi,
> Is there anyway to list a set of files in a directory whose size is
> greater than some value?
man find
> Or to display in sorted order by size? Any UNIX command?
man sort
--
__Pascal Bourguignon__ http://www.informatimago.com/
Our enemies are innovative and resourceful, and so are we. They never
stop thinking about new ways to harm our country and our people, and
neither do we.
|
|
0
|
|
|
|
Reply
|
Pascal
|
9/24/2004 6:38:46 AM
|
|
2004-09-23, 22:12(-07), Nithya Venkatachalam:
> Is there anyway to list a set of files in a directory whose size is
> greater than some value?
Use the zsh shell:
print -rl -- *(L+100)
lists the files larger than 100 bytes.
> Or to display in sorted order by size? Any UNIX command?
> Nithya
print -rl -- *(oL)
lists the files sorted by size.
--
Stephane
|
|
0
|
|
|
|
Reply
|
Stephane
|
9/24/2004 8:43:05 AM
|
|
Thanks.
And ls -l | sort -n -k 5,5
served my purpose of listing sorted by size.
5 is the column number in which size is displayed in ls -l.
|
|
0
|
|
|
|
Reply
|
Nithya
|
9/24/2004 10:22:15 AM
|
|
Thanks.
And ls -l | sort -n -k 5,5
served my purpose of listing sorted by size.
5 is the column number in which size is displayed in ls -l.
|
|
0
|
|
|
|
Reply
|
Nithya
|
9/24/2004 10:22:18 AM
|
|
"Nithya Venkatachalam" <vnithya@gmail.com> writes:
> Thanks.
> And ls -l | sort -n -k 5,5
>
> served my purpose of listing sorted by size.
ls -lS does the same thing.
--
M�ns Rullg�rd
mru@mru.ath.cx
|
|
0
|
|
|
|
Reply
|
iso
|
9/24/2004 10:25:37 AM
|
|
M�ns Rullg�rd <mru@mru.ath.cx> writes:
> "Nithya Venkatachalam" <vnithya@gmail.com> writes:
>
>> Thanks.
>> And ls -l | sort -n -k 5,5
>>
>> served my purpose of listing sorted by size.
>
> ls -lS does the same thing.
Sorry, that sorts in descending order. To sort ascending, use ls -lSr.
--
M�ns Rullg�rd
mru@mru.ath.cx
|
|
0
|
|
|
|
Reply
|
iso
|
9/24/2004 10:26:55 AM
|
|
2004-09-24, 12:26(+02), M�ns Rullg�rd:
> M�ns Rullg�rd <mru@mru.ath.cx> writes:
>
>> "Nithya Venkatachalam" <vnithya@gmail.com> writes:
>>
>>> Thanks.
>>> And ls -l | sort -n -k 5,5
>>>
>>> served my purpose of listing sorted by size.
>>
>> ls -lS does the same thing.
>
> Sorry, that sorts in descending order. To sort ascending, use ls -lSr.
-S is a GNU specific option.
--
Stephane
|
|
0
|
|
|
|
Reply
|
Stephane
|
9/24/2004 1:21:12 PM
|
|
Nithya Venkatachalam wrote:
> Hi,
> Is there anyway to list a set of files in a directory whose size is
> greater than some value?
> Or to display in sorted order by size? Any UNIX command?
> Nithya
>
Don't forget, 'ls' means 'list sorted' anyway ;-)).
Hence, it should not be too complex to take the files'
sizes, rather than their names, as the sorting criterium...
For ex., on the Linux system I'm typing this, ls is
$ LC_MESSAGES=C ls --version
ls (fileutils) 4.1
Written by Richard Stallman and David MacKenzie.
(...)
i.e. the GNU implementation.
The resp. manpage reveals
-S sort by file size
ad libitum to be combined with
-r, --reverse
reverse order while sorting
Voil�, as for the 2nd question.
For the 1st one: In one of my scripts, I use the line
find /var/spool/news -type f -size +10k -not -name '.overview' -ls | \
sort -k 7,8 -n | uniq -c -w 67 >~/Log.size.news
Again, the '-ls' option to 'find' is a GNU speciality AFAIK.
[But you weren't specific about the particular Unix / Unixoid system
you asked for. And IMHO, this question would have been more suitable
to c.u.questions or c.u.shell.]
Juergen
|
|
0
|
|
|
|
Reply
|
Juergen
|
9/25/2004 3:13:46 AM
|
|
|
8 Replies
399 Views
(page loaded in 0.433 seconds)
Similiar Articles: ls or sort on size ?? - comp.unix.programmerHi, Is there anyway to list a set of files in a directory whose size is greater than some value? Or to display in sorted order by size? Any UNIX comma... Solaris 8: How do your sort the results of LS by Date? Thanks ...how to sort a huge file - comp.soft-sys.sas ls or sort on size ?? - comp.unix.programmer how to sort a huge file - comp.soft-sys.sas Solaris 8: How do your sort the ... /bin/ls: arg list too long - comp.unix.solarisI have a directory which contains 21 thousand files. when I am running following command I am getting error: ls -t /path-to-my-dir/*.Z | head -1 Err... how to sort a huge file - comp.soft-sys.sasls or sort on size ?? - comp.unix.programmer how to sort a huge file - comp.soft-sys.sas Solaris 8: How do your sort the results of LS by Date? Directory sort by filename - comp.lang.c++.moderatedls or sort on size ?? - comp.unix.programmer Hi, Is there anyway to list a set of files in a directory whose ... and Linux ls command sorting options, including how to ... List Files By Date Range - comp.unix.programmerIs it possible to list a group of files by date range using UNIX command (i.e. ls ... comp.unix.programmer List files in date range in some dir ... Help: scripted sort with ... Luxadm display - comp.unix.solarisls or sort on size ?? - comp.unix.programmer Luxadm display - comp.unix.solaris how to find the size of each disk - comp.unix.solaris You can also use ... file list sorted by creation date - comp.lang.rubysort_by it: Dir.entries(".").sort_by{|c| File.stat(c).ctime} ... Date In Windows 7... is a small portable utility that can quickly sort and list files by size ... Sort the file - comp.lang.awkSolaris 8: How do your sort the results of LS by Date? Thanks ... sort files by date - The UNIX and Linux Forums sort files by date ... but I lost my notes on it. Huge disk usage on /var/spool/clientmqueue - comp.unix.solaris ...bash-3.00$ df -h Filesystem size used avail capacity Mounted on /dev ... have tons of files in /var/spool/clientmqueue # pwd /var/spool/clientmqueue # ls ... ls - Linux Command - Unix Command - Linux Operating System and ...Linux / Unix Command Library: ls. Learn about its synopsis, description, options ... sort by file size--sort=WORD extension -X, none -U, size -S, time -t, version -v How to sort Linux ls command file output | Unix Linux ls command ...A quick look at Unix and Linux ls command sorting options, including how to sort by file size, file modification time, filename extension (file type), and more. 7/24/2012 1:19:15 AM
|