News for hackers. Stuff that matters.
Re:Unix doesn’t follow the Unix philosophy by telemachos on Friday May 25, 2012 @09:41AM (#4023392)
> No, ls has dozens of tangled options because the philosophy is to "do one thing and do it well".

Do you mean that in order to truly do well its one thing (list information about files), that ls had to incorporate things like these?

      -o      List in long format, but omit the group id.

      -T      When used with the -l (lowercase letter ``ell'') option, display complete
              time information for the file, including month, day, hour, minute, second,
              and year.

      -x      The same as -C, except that the multi-column output is produced with entries
              sorted across, rather than down, the columns.
Some degree of feature creep is probably inevitable, but a lot of the common utilities now seem to lean towards "offer a flag for everything" rather than "do a small number of permutations on one thing; create pipelines for the rest". (Note: These three options are all from OSX's BSD-derived ls. GNU's version is almost certainly more complex still.)
Re:Unix doesn’t follow the Unix philosophy by masklinn on Friday May 25, 2012 @10:02AM (#4023488)
> that ls had to incorporate things like these?

Or this bunch:

     -p      Write a slash (`/') after each filename if that file is a directory.

     -r      Reverse the order of the sort to get reverse lexicographical order or the oldest entries first (or largest files last, if combined with sort by size

     -S      Sort files by size
* -p's information is redundant with the first character of the long format

* -S (and -r) are redundant with `sort` (ls -lSr -> ls -l | sort -k5; ls -lS -> ls -l | sort -rk5)

Re:Unix doesn’t follow the Unix philosophy by lmm on Friday May 25, 2012 @10:21AM (#4023585)
-p is immensely useful. Of course it's redundant in long format; it's for using in short format.

-r is also very useful (I use -tr all the time, which I can't immediately see how I'd replace with sort), and while I could replace ls -lS with piping into sort, you seem to be assuming ls will always be outputting one file per line, which is far from its most useful output mode when running it in a terminal.

Re:Unix doesn’t follow the Unix philosophy by masklinn on Friday May 25, 2012 @10:38AM (#4023657)
> you seem to be assuming ls will always be outputting one file per line

No, I am assuming a "do one thing" `ls` would be used in long format (or as inode numbers) whenever it need to be worked with, and would be massaged into form by further commands. For `t`, `r`, `S` and a bunch of others you'd ls, sort and then cut/awk/whatever to format into a "short form".

Not that it matters a bit.

Also, I didn't claim these weren't useful, I claimed they were redundant. Which they are.

Re:Unix doesn’t follow the Unix philosophy by sp332 on Friday May 25, 2012 @10:18AM (#4023563)
-o is probably for compatibility with some other system. -T seems useful doesn't it? How else would you get that info? And -x is a personal preference. None of those seem especially useless.
Re:Unix doesn’t follow the Unix philosophy by telemachos on Friday May 25, 2012 @10:28AM (#4023621)
> -T seems useful doesn't it? How else would you get that info?

The long (-l) format already provides the month, day, hour and minutes. -T adds only seconds and the year. No utility can possibly provide every format option that someone might find useful. If you really needed that format, and ls were leaner, you would need to write a script (in whatever language).

> And -x is a personal preference.

Basic utilities shouldn't include so many options that are variants for personal preferences.

> None of those seem especially useless.

I don't think that they are outrageously useless, but let's set the bar higher. The core utilities should be, in my opinion, much much leaner than they are.