Sponsored Content
Full Discussion: Sorting ls by filesize
Top Forums UNIX for Dummies Questions & Answers Sorting ls by filesize Post 22500 by manderson19 on Tuesday 4th of June 2002 07:28:09 PM
Old 06-04-2002
try:

ls -al | sort -rn +4

this does a reverse numerical sort by file size. hope this helps.
This User Gave Thanks to manderson19 For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

filesize

I know in php if you use the function filesize it will return the size of the file in bytes, but is there an easy way to get the size in MB. Cheers (2 Replies)
Discussion started by: jmg5
2 Replies

2. Shell Programming and Scripting

FileSize ???

How do I identify if there is any content in a file? If there is nothing in a specified file, I'd like to send an email indicating that there is nothing to report. Any help appreciated. (3 Replies)
Discussion started by: Cameron
3 Replies

3. Shell Programming and Scripting

How to truncate as filesize?

Hello everybody it's me again. I have a procces that is writing in a 'file1' automatically but i want to truncate 'file1' to a filesize 'x' that mean if the 'file1' size is 'x' i want to delete the first lines while the last lines are being writed, that have sence? in the process are an... (1 Reply)
Discussion started by: Lestat
1 Replies

4. HP-UX

Increasing Filesize on HP-UX UNIX

Dear sir My hp-ux OS version is 11i (11.23) , and Oracle DB is 9i (9.2.0.6) the problem that I can't create any file (DB datafile , export Dump file , Rman backup pices.... etc) under the OS biger than 2 GB and the csh % limit check is %limit cputime unlimited filesize ... (4 Replies)
Discussion started by: ae_nassar
4 Replies

5. UNIX for Dummies Questions & Answers

UNIX and filesize

Hey guys. What I need to do is this: I need to find files that have a certain filesize (for this case a file size of 0 (zero) ) When I find this file with a filesize of zero I need to echo a statement that tells the user to delete it and not to delete it if the filesize is greater than... (3 Replies)
Discussion started by: ndoggy020
3 Replies

6. Shell Programming and Scripting

filesize

I want to know if there is any unix command to view the size of the file? eg. i have a directory letter in this i have file a,b,c,d,e. i just want to know the size of file d and not any other. (3 Replies)
Discussion started by: infyanurag
3 Replies

7. Shell Programming and Scripting

getting filesize

Hello, I have a script that should store file size in a variable $filesize. I don't know what is the best way to do it. I tried ls -lt myfile.txt | sed something >$filesize but I don't know how to use sed to get filesize. I know that the owner of the file is root and then we have some... (6 Replies)
Discussion started by: pppswing
6 Replies

8. Shell Programming and Scripting

Filesize not working

I am having problems with finding the filesize with this in my script: filesize=`ls -l | awk '$5=0'` if ; then ls -l | awk '{print $9 " " $5}' if ; then echo "Would you like to delete this file? (y/n)" if yes do this elif no do this fi fi else... (7 Replies)
Discussion started by: akeenabawa
7 Replies

9. Solaris

Check for filesize limit

How do I check for any file size limitations in a directories ? I remember my administrator had set a file limitation for a certain directory. I would like to know how I can check that. Thank you. (2 Replies)
Discussion started by: Leion
2 Replies

10. Shell Programming and Scripting

if condition for filesize

Hi, I want to check file size in unix, based on file size I am going to execute appropriate command. I tried below, but getting the error. System details – Machine hardware: sun4u OS version: 5.9 if ( -s $f1 ) then echo "filename exists and is > 0 bytes" else echo "filename... (7 Replies)
Discussion started by: rahulbahulekar
7 Replies
SORT(1) 							   User Commands							   SORT(1)

NAME
sort - sort lines of text files SYNOPSIS
sort [OPTION]... [FILE]... sort [OPTION]... --files0-from=F DESCRIPTION
Write sorted concatenation of all FILE(s) to standard output. Mandatory arguments to long options are mandatory for short options too. Ordering options: -b, --ignore-leading-blanks ignore leading blanks -d, --dictionary-order consider only blanks and alphanumeric characters -f, --ignore-case fold lower case to upper case characters -g, --general-numeric-sort compare according to general numerical value -i, --ignore-nonprinting consider only printable characters -M, --month-sort compare (unknown) < 'JAN' < ... < 'DEC' -h, --human-numeric-sort compare human readable numbers (e.g., 2K 1G) -n, --numeric-sort compare according to string numerical value -R, --random-sort sort by random hash of keys --random-source=FILE get random bytes from FILE -r, --reverse reverse the result of comparisons --sort=WORD sort according to WORD: general-numeric -g, human-numeric -h, month -M, numeric -n, random -R, version -V -V, --version-sort natural sort of (version) numbers within text Other options: --batch-size=NMERGE merge at most NMERGE inputs at once; for more use temp files -c, --check, --check=diagnose-first check for sorted input; do not sort -C, --check=quiet, --check=silent like -c, but do not report first bad line --compress-program=PROG compress temporaries with PROG; decompress them with PROG -d --debug annotate the part of the line used to sort, and warn about questionable usage to stderr --files0-from=F read input from the files specified by NUL-terminated names in file F; If F is - then read names from standard input -k, --key=KEYDEF sort via a key; KEYDEF gives location and type -m, --merge merge already sorted files; do not sort -o, --output=FILE write result to FILE instead of standard output -s, --stable stabilize sort by disabling last-resort comparison -S, --buffer-size=SIZE use SIZE for main memory buffer -t, --field-separator=SEP use SEP instead of non-blank to blank transition -T, --temporary-directory=DIR use DIR for temporaries, not $TMPDIR or /tmp; multiple options specify multiple directories --parallel=N change the number of sorts run concurrently to N -u, --unique with -c, check for strict ordering; without -c, output only the first of an equal run -z, --zero-terminated end lines with 0 byte, not newline --help display this help and exit --version output version information and exit KEYDEF is F[.C][OPTS][,F[.C][OPTS]] for start and stop position, where F is a field number and C a character position in the field; both are origin 1, and the stop position defaults to the line's end. If neither -t nor -b is in effect, characters in a field are counted from the beginning of the preceding whitespace. OPTS is one or more single-letter ordering options [bdfgiMhnRrV], which override global order- ing options for that key. If no key is given, use the entire line as the key. SIZE may be followed by the following multiplicative suffixes: % 1% of memory, b 1, K 1024 (default), and so on for M, G, T, P, E, Z, Y. With no FILE, or when FILE is -, read standard input. *** WARNING *** The locale specified by the environment affects sort order. Set LC_ALL=C to get the traditional sort order that uses native byte values. GNU coreutils online help: <http://www.gnu.org/software/coreutils/> Report sort translation bugs to <http://translationproject.org/team/> AUTHOR
Written by Mike Haertel and Paul Eggert. COPYRIGHT
Copyright (C) 2013 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. SEE ALSO
uniq(1) The full documentation for sort is maintained as a Texinfo manual. If the info and sort programs are properly installed at your site, the command info coreutils 'sort invocation' should give you access to the complete manual. GNU coreutils 8.22 June 2014 SORT(1)
All times are GMT -4. The time now is 10:47 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy