Skip to content

Instantly share code, notes, and snippets.

@guziy
Created June 9, 2016 21:58
Show Gist options
  • Save guziy/d7d7fa5d542d61afbd5a6c1cc65b9e27 to your computer and use it in GitHub Desktop.
Save guziy/d7d7fa5d542d61afbd5a6c1cc65b9e27 to your computer and use it in GitHub Desktop.
#!/bin/bash
# save the listing into an array
z=($(ls -a))
# loop through the array elements and print the sizes (skip the "." and "..")
for zi in ${z[@]:2}; do
du -sh ${zi}
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment