cash icon indicating copy to clipboard operation
cash copied to clipboard

`ls -s` is missing

Open thany opened this issue 9 years ago • 5 comments

I'm very used to typing ls -las. It's in my bones. But the -s option isn't available - so can it please be implemented? Or, since the size is already printed with ls -la, it could also be ignored...

Right now it prints an error message for this switch, even though, technically speaking, it's not an error. It's just not implemented ;)

thany avatar Feb 29 '16 11:02 thany

Got it! Will implement as soon as I can.

dthree avatar Feb 29 '16 17:02 dthree

Brilliant!

I'm curious to what it will be exactly, since it implicitly already works :)

thany avatar Feb 29 '16 19:02 thany

Looks like ls -l and ls -ls are different on my system:

$ ls -l
-rw-rw-r-- 1 user user  126 Feb 29 13:37 foo.txt
-rw-rw-r-- 1 user user  223 Feb 29 15:11 bar.txt
-rw-rw-r-- 1 user user  101 Feb 29 13:40 baz.txt

$ ls -ls
4 -rw-rw-r-- 1 user user  126 Feb 29 13:37 foo.txt
4 -rw-rw-r-- 1 user user  223 Feb 29 15:11 bar.txt
4 -rw-rw-r-- 1 user user  101 Feb 29 13:40 baz.txt

I think -l gives size in byes, and -s adds in size in blocks.

nfischer avatar Feb 29 '16 19:02 nfischer

You know, I've never noticed actually. That's how used I am to it :)

But then it might prove a bit more challenging especially on systems that probably maybe don't expose sizes in number of blocks (like Windows). Not sure what I'd expect there on Windows, to be honest.

thany avatar Feb 29 '16 19:02 thany

A stackoverflow post led me to this helpful section of the source. Looks like this is only available on POSIX.

A warning might be a good alternative if the actual behavior can't be supported.

nfischer avatar Feb 29 '16 20:02 nfischer