Hacking ls -l
lemis.com
Hacking ls -l
1–10 of 93 posts
Re: Hacking ls -l
#2Re: Hacking ls -l
#3(that said, I do see the utility, since it gives a more obvious visual queue as to the order of size differences... but if you're doing anything with the sizes programatically, you have to remove the commas afterwards... Short version: if you're going to do this, make it a unique flag, or a new flag modifier to the -l flag... don't overload the -l flag without recourse...)
Re: Hacking ls -l
#4Alternatively, do you know about ls -lhrS? It will print size in human formats and reverse sort the files by size - ie the bigger will be at the end of the list
Re: Hacking ls -l
#5While I appreciate the story, what's wrong with `ls -lh`?
Re: Hacking ls -l
#6Makes you wonder whether anyone ever considered the problem before...
Re: Hacking ls -l
#7Is this front page worth materiel? I mean, it's good you took the time to add a ', but doing the same with sed would have been faster. Alternatively, do you know about ls -lhrS? It will print size in human formats and reverse sort the files by size - ie the bigger will be at the end of the list
Re: Hacking ls -l
#8While I appreciate the story, what's wrong with `ls -lh`?
My thoughts exactly. This is just complexity for complexity's sake. Useful as an exercise, but the -h flag already does this is an even more readable manner.
Re: Hacking ls -l
#9Rather, this is a pretty interesting look into what it actually entails to make what ought to be a very simple and straightforward change.
It turns out that these simple changes are hard! Not just in identifying the piece of code to modify, but that man pages are often incomplete or unclear. It also illustrates the complexities behind making software portable - in this case, using the nation-neutral place separator. It also reminds us that solving what is on the surface a simple problem lets one uncover all sorts of interesting and messy details underneath - including more problems to solve!
These are steps that he'd have to take no matter what the code or feature. This article is not "complexity for complexity's sake", it's illustrating the complexity of making changes to any piece of code - and that it is surprisingly difficult for something that one would think is very easy!
Re: Hacking ls -l
#10Earlier quoted context omitted.
My thoughts exactly. This is just complexity for complexity's sake. Useful as an exercise, but the -h flag already does this is an even more readable manner.
This works with sorting, and it's easier to pick big files out at a glance. I would use this as often as -h