3 ms·
Show HN: Bash one-liner to get human-readable file size
Here's the one-line function you can add to your .bashrc or .zshrc:
wcc() { wc -c < $1 | numfmt --to=iec-i --suffix=B --format="%9.2f" }
And then you may invoke it as "wcc ./anyfile"
- lantry 3y agowhy not ls -h or du -h ?
- simonblack 3y agoOr even plain old ls -l ? But strangely enough, the very first thought that popped into my head was the use of 'wc'. Weird, huh?