29 ms·
You hit the nail on the head! Like I've said in these comments, I'm constantly surprised by which settings people change and which ones they don't, so differin
by cytzol 9y ago
You hit the nail on the head!
Like I've said in these comments, I'm constantly surprised by which settings people change and which ones they don't, so differing opinions on exa's defaults is nothing new. exa shares my opinion of wanting to see thousand separators and byte suffixes by default; ls, on the other hand, has no opinion because with file sizes that small, it didn't really have to choose what the output should be like.
People have said that in scripts you'd want to just output the file size in bytes, and they're right, otherwise the numbers won't sort correctly. If you're writing a script, though, you're going to be taking more care than if you were just wanted to list some files. I've lost count of the number of times I've listed a directory, given up trying to count the digits of the file sizes, then re-ran the command with `ls -h`, but I've never written a script without thinking about what the output should be like.
- kbenson 9y ago> People have said that in scripts you'd want to just output the file size in bytes, and they're right, otherwise the numbers won't sort correctly. Actually, many of the utilities that output in human readable format do so in a way that's also sortable through sort's -h option. It might be worth making sure you have a mode that outputs the same way so people can easily utilize sort. That is, K/M/G instead of Ki,Mi, Gi. Unless sort ignores the second alpha character when using -h and it still works, then no problem. :) Edit: Actually, I just tested, and at least as of the sort in coreutils 8.4, it recognizes both forms, and actually dies with a warning if you mix them, so you're all good! # echo -e "100Mi\n100Ki\n10Mi\n10Ki" | sort -h 10Ki 100Ki 10Mi 100Mi # echo -e "100Mi\n100Ki\n10Mi\n10K" | sort -h sort: both SI and IEC prefixes present on units