Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
felixgallo
on March 12, 2023
|
parent
|
context
|
favorite
| on:
Nushell.sh ls | where size > 10mb | sort-by modifi...
du -s * | sort -n -r | sed 10q
theossuary
on March 12, 2023
|
next
[–]
Okay, but now show me the size of the file in a human readible format next to the name.
benhoyt
on March 12, 2023
|
parent
|
next
[–]
You can use the "-h" (human-readable) options to du and sort to do this:
$ du -sh * | sort -rh 20M dist 6.9M pebble 1.5M internal 308K cmd ...
PeterWhittaker
on March 12, 2023
|
parent
|
prev
|
next
[–]
du -s -h * | sort -r -h
matja
on March 12, 2023
|
parent
|
prev
|
next
[–]
add: | numfmt --to=iec
felixgallo
on March 12, 2023
|
parent
|
prev
|
next
[–]
it's already in a human readable format next to the name.
e12e
on March 12, 2023
|
prev
[–]
"sed 10q" is equivalent to "head"?
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: