Berkeley CSUA MOTD:Entry 30093
Berkeley CSUA MOTD
 
WIKI | FAQ | Tech FAQ
http://csua.com/feed/
2025/07/08 [General] UID:1000 Activity:popular
7/8     

2004/5/7 [Computer/Theory, Computer/SW/Unix] UID:30093 Activity:high
5/7     How do I make ls sort files by size like -t for time? thx
        \_ From man ls:
           The following is how to do an ls listing sorted by size
           (and shows why ls does not need a separate option for this):

           ls -l | sort -n +4

        \_ use Linux, it's -S
           \_ I want to do this on soda!
              \_ download gnu fileutils, compile, presto.
              \- ls -ls | sort -n[r] --psb
                 \_  ls -ls | sort -n[r]
                     sort: No match.
                     \- dont actually type the [], you doofus --psb
                 \_ ls -l | sort +4   is more general.
                    \- it's more fragile. ls -s always makes the sort field
                       first. otherwise the field can depend on whether the
                       group owner is listed etc ... varies by ls flavor,
                       ls aliases etc --psb
                       \_ well, I meant since it depends on block size it
                          would fail by default for tiny files.
                          \- fair enough, but really arnet you just looking
                             for the biggest file 95% of the time. --psb
                    \_ Add a -n for good measure.  Not all platforms will
                       detect an all numeric column, so "sort -n +4"
                       \_ ok, but he said "want to do this on soda!" :)
                          frankly though I think the man page is stupid and
                          it should be an ls option for convenience. they
                          have the other sorting functionality.
                          \_ They have sorting for time becuase sorting human
                             readable dates is difficult with other default
                             command line tools.  Sorting file size is easy.
                             This is the UNIX way.  many modular pieces you
                             can piece together to do what you want.  Linux
                             makes you weak. --scotsman
                             \_ it's a bunch of extra characters to type for
                                a basic, common desire that could very easily
                                just be in ls where normal people expect. (hey,
                                why should sort have a field option anyway? you
                                can just manipulate lines using 'cut' etc. It's
                                the way real men do it.)
                             \_ don't be a doofus--it's not like FreeBSD
                                "ls" is "pure" (color "ls" doesn't make you
                                weak, but sorting on size does?)  -tom
                                \_ I wasn't talking about purity.  And I guess
                                   it wasn't clear that I was being facetious.
                                   But the point stands that to pull sort into
                                   ls with yet another command line option
                                   makes ls more tedious to remember how to use
                                   and postpones the newer user's learning how
                                   to use sort.  And who uses color ls?
                                   --scotsman
                                   \_ how is it more tedious?  If you don't
                                      want to use -S, pipe it through sort
                                      instead.  -tom
                                      \_ I guess I'm just sick of interviewing
                                         IT drones who can't write a decent
                                         command line.. --scotsman
                                         \- how about adding a du flag that
                                            just means du all the directories
                                            under here but not the files.
                                            how about another du flag that
                                            is directories only in size
                                            order. and another that sorts
                                            based on number of files rather
                                            than cumul size.. --psb
                                            \_ Ah yes, I forgot; the only
                                               "official" command-line options
                                               are the ones that FreeBSD has
                                               adopted.  Therefore it's OK
                                               to use "find -delete", but not
                                               "ls -S"  -tom
                                                   \- pure is BSD 4.3 --psb
                                   \_ color ls is the best thing since linux!
                                      just like color monitor is the best thing
                                      since monochrome green terminals.
                                   \_ Once you begin to appreciate color ls, you
                                      will never go back, like a lot of things.
                                      \- dired >> ls --psb
        \_ using sort -n +5 gets rid of the color, oh fuck, fuck!!
        \_ If you are using a terminal with black background, try
           LSCOLORS=BxDxFxdxCxdxdxBxBxBxBx and do ls -G
           \_ Cool, ls -lG / looks nice!
ERROR, url_link recursive (eces.Colorado.EDU/secure/mindterm2) 2025/07/08 [General] UID:1000 Activity:popular
7/8     

You may also be interested in these entries...
2012/8/30-11/7 [Computer/SW/Apps, Computer/SW/Unix] UID:54470 Activity:nil
8/30    Is wall just dead? The wallall command dies for me, muttering
        something about /var/wall/ttys not existing.
        \_ its seen a great drop in usage, though it seems mostly functional.
            -ERic
        \_ Couldn't open wall log!: Bad file descriptor
           Could not open wall subscription directory /var/wall/ttys: No such file or directory
	...
2011/11/20-2012/2/6 [Computer/Companies/Apple, Computer/SW/Unix] UID:54237 Activity:nil
11/20   Are there tools that can justify a chunk of plain ASCII text by
        replacing words with words of similar meaning and inserting/removing
        commas into the text?  I received a 40-line plain text mail where
        all the lines are justified on left and right.  Every word and comma
        is followed by only one space, and every period is followed by two
        spaces.  The guy is my kid's karate instructor which I don't think is
	...
2011/10/26-12/6 [Computer/SW/Unix] UID:54202 Activity:nil
10/24  What's an easy way to see if say column 3 of a file matches a list of
       expressions in a file? Basically I want to combine "grep -f <file>"
       to store the patterns and awk's $3 ~ /(AAA|BBB|CCC)/ ... I realize
       I can do this with "egrep -f " and use regexp instead of strings, but
       was wondering if there was some magic way to do this.
       \_ UNIX has no magic. Make a shell script to produce the ask or egrep
	...
2010/11/21-2011/1/13 [Computer/SW/Languages/Web] UID:53988 Activity:moderate
11/21   Lifehacker's recommending Dreamhost as a personal web hosting service.
        Apart from csua, who do you guys use? --erikred
        \_ What do you want to use it for? Do you need CGI or PHP?  My
           brother worked for Dreamhost and said they are unethical. In
           fact, he sued them. This refers to their treatment of customers
           and employees both. I don't know who  or what "Lifehacker" is,
	...
2010/8/29-9/30 [Recreation/Humor, Politics/Foreign/Europe, Computer/Theory] UID:53940 Activity:nil
8/29    http://www.google.nl/trends?q=ramadan,+porno&ctab=0&geo=ma&date=all&sort=0
        Funny graph.  -- linkpusher
	...
2012/8/29-11/7 [Computer/SW/Security] UID:54467 Activity:nil
8/29    There was once a CSUA web page which runs an SSH client for logging
        on to soda.  Does that page still exist?  Can someone remind me of the
        URL please?  Thx.
        \_ what do you mean? instruction on how to ssh into soda?
           \_ No I think he means the ssh applet, which, iirc, was an applet
              that implemented an ssh v1 client.  I think this page went away
	...
2012/3/29-6/4 [Computer/HW/Memory, Computer/HW/CPU, Computer/HW/Drives] UID:54351 Activity:nil
3/29    A friend wants a PC (no mac). She doesn't want Dell. Is there a
        good place that can custom build for you (SSD, large RAM, cheap video
        card--no game)?
        \_ As a side note: back in my Cal days more than two decades ago when
           having a 387SX made me the only person with floating-point hardware,
           most machines were custom built.
	...
2012/1/27-3/26 [Computer/SW/Unix] UID:54299 Activity:nil
1/27    Interesting list of useful unix tools. Shout out to
        cowsay even!
        http://www.stumbleupon.com/su/3428AB/kkovacs.eu/cool-but-obscure-unix-tools
        \_ This is nice.  Thanks.
	...