Too many ls options?
2016-09-10 13:06On IRC we'd been discussing procmail, and its lack of maintenance, and whether it *needs* maintenance other than security fixes. I snarked about wc not needing updates... then checked and found that its web page was dated Jan 2016, because GNU. This led to Ian complaining about ls having too many options, and he didn't even know about the dired output ones for emacs integration. I count about 56 options. That's a lot!
OTOH, I use a lot of them:
All my aliases use -F and -color=auto.
lt uses -ltr
Others use u, A, s, h, and d. That's 10.
I discovered L recently, and found it useful. Others on the list look interesting: --group-directories-first, R, S, X. 14 total! Still a fraction of the total, but I'm not going to say the others are useless.
Are they redundant with the Unix way? E.g. all the sort options could instead be piped to /bin/sort. OTOH that would be more verbose, and less efficient, especially for e.g. a numeric sort on filesize: easier to sort within ls, which has the numbers as numbers, rather than to print them as text to stdout, read them in again and convert, then print out again. Or more commonly, sorting by modification time, as a human readable thing? Ew.
*** Reference
-F: append / for directories and * for exectuables and @ for symlinks.
-color: colors by type
-l: detailed listing
-t: sorts by modification time, newest first
-r: reverses sort
-u: show last access time
-A: show dotfiles, but not . and ..
-s: show file size in blocks
-h: print size in human friendly form, like 4.3M
-d: shows properties of a directory, rather than its contents.
--group-directories-first: duh
-R: recursive
-S: sort by size, biggest first.
-X: sort by extension.
OTOH, I use a lot of them:
All my aliases use -F and -color=auto.
lt uses -ltr
Others use u, A, s, h, and d. That's 10.
I discovered L recently, and found it useful. Others on the list look interesting: --group-directories-first, R, S, X. 14 total! Still a fraction of the total, but I'm not going to say the others are useless.
Are they redundant with the Unix way? E.g. all the sort options could instead be piped to /bin/sort. OTOH that would be more verbose, and less efficient, especially for e.g. a numeric sort on filesize: easier to sort within ls, which has the numbers as numbers, rather than to print them as text to stdout, read them in again and convert, then print out again. Or more commonly, sorting by modification time, as a human readable thing? Ew.
*** Reference
-F: append / for directories and * for exectuables and @ for symlinks.
-color: colors by type
-l: detailed listing
-t: sorts by modification time, newest first
-r: reverses sort
-u: show last access time
-A: show dotfiles, but not . and ..
-s: show file size in blocks
-h: print size in human friendly form, like 4.3M
-d: shows properties of a directory, rather than its contents.
--group-directories-first: duh
-R: recursive
-S: sort by size, biggest first.
-X: sort by extension.