0

I'd like to list all the files beginning with z, have their individual filesize, and the total size in the bottom of the list (so I don't have to scroll up like with ls -s).

DOS equivalent : dir z*

I don't even know if this is done with ls, but I suppose there is a simple way to do that...

1 Answer 1

3

Using du:

du -d 0 -hc z*
  • -d 0: specifies the maximum level of recursion;
  • -h: prints the sizes in a human-readable format;
  • -c: prints a grand total;
  • z*: globbing pattern which is expanded to the list of files / directories starting with z in the current working directory.
$ du -d 0 -hc z*
1,2M    zsh-syntax-highlighting
1,2M    total
0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .