COMPGROUPS.NET | Search | Post Question | Groups | Stream | About | Register

### ls or sort on size ??

• Email
• Follow

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

See related articles to this posting

"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

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

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

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

"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

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

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

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 580 Views Similar Articles 12/10/2013 10:20:17 PM page loaded in 255648 ms. (0)  Reply: Similar Artilces: Sorting out sort I'm trying to extract a column from a flatfile database and print it alphabetically. I can get the data out, but I can't get it to sort. The database is pipe-separated in a plain text file and looks like this: Ref_no|Title|County|Another_field|And_another|And_another 1234|A Name|Devon|Data here|More data here|And more data 1234|A Name|Somerset|Data here|More data here|And more data 1234|A Name|Nottinghamshire|Data here|More data here|And more data 1234|A Name|Essex|Data here|More data here|And more data .... and so on My routine is as follows: #open the file open (INFILE, 'dat... Code size as a function of source size Hi, I would like to pose a very simple question, for which nevertheless I could not find an answer through google: Of what general type is the dependence of the size of compiled code to the size of the respective source code? Or to put it "mathematically", what function f(s) approximates the points (s, o(s)) best, where s is the size of the source code (say in bytes and normalized by removing commentaries and not using uncommonly long identifiers or amounts of white space) and o(s) is the size of the corresponding object code (without any libraries linked in). It seems natu... sorting What is the most efficent way to sort a LARGE list? The data is read in from file and the file get up dated daily and not sorted and during the day more data is addded. The data need to be sort and increase the speed of retiving data using a binary search. On Sat, 18 Oct 2003 13:16:47 +1000, "Rookie" <a@a.co> wrote or quoted : >What is the most efficent way to sort a LARGE list? If you add to a sorted list, the fastest way is to sort the additions then merge them. see http://mindprod.com/products.html#SORTED for a Merge class to do that. It presumes you have enough r... Artboards, page sizes, thumbnail sizes, and iView MediaPro? I'm now keeping all my large collection of slides and master images as PDF files in uniform 11 X 8.5 inch Landscape format which are edited in Illustrator, assembled and projected in Acrobat, cataloged in iView MediaPro. Only annoying hassle is that while many of these slides more or less fill the PDF page, some of my original or master images are considerably smaller �� the image content you select with cmd-A in Illustrator is only maybe 4 X 3 inches in the 11 X 8.5 inch page �� and the resulting thumbnails for these images in iView MediaPro catalogs are similarly small, since iV... sorting arrays I am hoping to improve on the technique for sorting values within an array (in a data step), which I implement using a macro. Is there a call or other non-macro solution to do this? Outputting the data and using proc sort is not an option. The program, whose purpose is to sort array B_ randomly, looks like this: Data testdata; Array a_ {*} a1-a7; Array b_ {*} b1-b7; Do i=1 to 7; A_(i)=ranuni(15151); B_(i)=I; End; Run; Data result; Set testdata; Array a_ {*} a1-a7; Array b_ {*} b1-b7; %sortaray(by=a_,others=b_); Run; ... page size ? Hi, Is there a command to find the size of the page ? pagesize doesn't work (11.0) Thanks in advance zeb wrote: > Hi, > > Is there a command to find the size of the page ? > pagesize doesn't work (11.0) > > Thanks in advance I don't remember a user space command (I don't remember ever wanting one either, honestly)... the sysconf(2) system call will tell you, though. The following should work for you to roll your own. #include <stdio.h> #include <errno.h> #include <unistd.h> int main(int argc, char *argv[]) { long page_size = 0; ... Array.sort() Hi, Why does Array.sort() don't work ? Hereby the code example, I cann't figger out what 's going wrong. <code> class Randomizer { public static int randomizer() { Random generator = new Random(); int getal = generator.nextInt(42) + 1; return getal; } } class Sortout{ public static int sortout ( int x) { int[] lotto = new int [6]; boolean getrokken; for (int i=0; i<6; i++) { do { getrokken = false; lotto[i] = Randomizer.randomizer(); for (int j=0; j<i; j++) if (lotto[i] == l... Bandwith Size Hi We have a CISCO 1600 router connected to a 64Kbs kilostream line. We are considering upping it to 256Kbs. My assumption is that the above Cisco will be able to cope with upto 2Mbit line without any hardware change. Am I right ? On the show interface, it states that Serial0 is a 64Kbs line, I assume that it is some sensing the capacity of line ? Sorry, I donot have the spec for the WIC card ! if it has one ( I know very little about CISCO) rc wrote: > Hi > > We have a CISCO 1600 router connected to a 64Kbs kilostream line. We > are considering upping it to 256Kbs. ... Sort and revert Hi, I have a vector which I have sorted B=sort(A); Now after changing the 10 values on either end I would like to take the vector back to A. B=sort(A); B(1:10)=20; B(90:100)=70; Now I want to transform B->A so that the indexing is same of what my A was. Since its an image I have to revert back to same indexing of vector only with changed values that I did after sorting. Any idea ? fas <faisalmufti@gmail.com> wrote in message <195e56e8-c7b9-49b3-839f-fd0468067e86@35g2000pry.googlegroups.com>... > Hi, > I have a vector which I have sorted B=sort(A); Now after changing the... Sorting a List Hi All, Help me to sort out the contents in the list box. The list box contains data elements like <first name> + <middle name> + <last name> as "Balaji Muthu Varathan" I want to sort it based on user preferences. ie. either it can be sort by last name or middle name or first name or in combinations With regards Balaji. M JRS: In article <1084535456.689127@sj-nntpcache-5>, seen in news:comp.lang.javascript, Balaji. M. <bmuthuva@cisco.com> posted at Fri, 14 May 2004 17:22:53 : >Help me to sort out the contents in the list box. > >The li... Hasta ls Vista Opportunities for hackers anon Oct 05 2005 As we all knew, it was only a matter of time before the new Windows Vista's supposed security was to be compromised. [...] The security in Windows is simply non-existent .. And that reality has been proved yet again by an Austrian who took advantage of Vista's new command line shell, Monad, to write what's now known as the first virus designed for Windows Vista, before Vista even exited the beta stage in development ... http://p2pnet.net/story/6495 Get a load of this image :) http://p2pnet.net/story_images/6495.jpg On Thu, 13 Oct 2... How do I change the size of an image? I want to right a function that changes the size of an image. I've tried the following: document["image0"].src.width = 300; This doesn't seem to work. What am I doing wrong? Jam "Jam" <jammer20002@yahoo.co.uk> writes: > I want to right a function that changes the size of an image. > > I've tried the following: > > document["image0"].src.width = 300; > > This doesn't seem to work. Try either document.images["image0"].width = 300; or document.images["image0"].style.width = "300... size of pdf created Hi I have a 3 page document that i created in InDesign. The doc has a coloured bar going down both edges (as a graphic frame with a coloured gradient) it seems from experimentation that the pdf created is 60K without these bars and 500k with them? Any ideas on how i can make the file size shorter - seems a bit big just to have a couple of coloured bars added to it. Thanks D ... Decreasing memory size Hi all, I want to compare a part of a sequence of data ie if data is 20-bits I want to compare only the 1st MSB. The detailed problem is as follows: The 20-bit data is stored in 4 RAMs each of size R*20-bits where R is the size of the RAM. My output is a 20-bit element array of length R. I would like to compare the MSBs of the data stored in ith address of each RAM. After every cycle the data of ith address of a RAM is shifted to the same address of next memory. So RAMs are acting in the shift-register fashion: ====== ====== ====== ====== --> |RAM1| --> |RAM2| --> ... xelatex and JPEG sizing I've been playing with moving my documents over from pdftex to xetex. I tried building one, but ran into a problem with JPEG sizes. Minimal example: \documentclass{article} \usepackage{graphicx} \begin{document} \includegraphics[height=5cm,width=2.97cm]{efield-dipole.jpg} \end{document} gives: ! Dimension too large. <to be read again> \relax l.4 ...,width=2.97cm]{efield-dipole.jpg} There's nothing fishy I can see with the image:$ identify efield-dipole.jpg efield-dipole.jpg JPEG 27...

application font size
Having just migrated from an iMac24 to a iMac27 (i7) the screen res increase (now c.109 ppi) has made the font in script editor and elsewhere, bordering on unreadable. The font in script editor on the 24 display looks like Lucida Grande 11 pt ; on the 27 display (although of course it is still Lucid 11 pt) it is effectively more like 9 pt on the 24 display. Each line is smaller in real space, by doing some simple measurements of the same text strings on screen, and replicate text in an editor to compare fonts, it is easy enough to deduce the comparative font size. So in rea...

Sizing pictures for printing
I'm currently using PSP 8.10. Hw do I set up orints to be a specific size? An example is recently I was trying to help out a friend with a picture for an ID badge and the picture had to be something like 1.5 x 1.75 inches. I ended up printing out six or seven different resized pictures until I got it close. How cold I have just printed it once at the size I needed? Or say, I want 2 x 3 inch wallet size pictures? How do I do so? Thanks. In news:00kbq490f0no31d5vjkcvc15blqafc8j06@4ax.com, <rfdjr1@optonline.net> rfdjr1@optonline.net bashed on keyboard and typed: > I'm current...

file size limitation?
I have a large data file that is continuously being added to. I want labview (in windows XP) to tell me the size of that file as it is updated, but there seems to be a 4GB threshold (I am using a U32 variable to display the size, so this makes sense). What I want to know is this - is there a way around this, or do I have to limit my file size to 4BG? Thanks! dlbuhl wrote: > I have a large data file that is continuously being added to. I want > labview (in windows XP) to tell me the size of that file as it is > updated, but there seems to be a 4GB threshold (I am using a U32 > v...

The memory size of a method?
I am passing around a structure, say: tsBob { int a; int b; int bobMethod(bool lb); }; I would like to make sure the structure is aligned along a 64-bit boundary (it's being thrown around the system). I assumed it was the size of a pointer (32-bits) but when I googled & wrote a little driver (See below) it was only 1 byte. Since I can't believe this does anyone have an answer? int main(int argc, char* argv[]) { tsBob aBob; cout << "Size of bobMethod is " << sizeof(aBob.bobMethod) << endl; return 0; } -- [ See http://www.g...

Re: Size of Dataset
Dear SAS-L-ers, Ash007 posted the following: > > Is it possible to retrieve the size of a dataset with a sas program. > Ash, you didn't state what type of "dataset" for which you are looking to retrieve the size thereof. (How's that for murdering the King's English)?!?!?!? Assuming that it is a SAS data set that you have already LIBNAME-d, you could simply use the FILESIZE variable in the SASHELP.VTABL view. Neat, simple, and no messy OS commands to soil your pristine SAS program. If your "dataset" is not a SAS data set, then you may en...