Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

du -s * | sort -n -r | sed 10q


Okay, but now show me the size of the file in a human readible format next to the name.


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
  ...


du -s -h * | sort -r -h


add: | numfmt --to=iec


it's already in a human readable format next to the name.


"sed 10q" is equivalent to "head"?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: