Jump to content

Directory size?


Recommended Posts

Try .....filelight.... excellent visual presentation and in depth detail of file sizes. Also shows percentages. Invaluable.

 

I always install it, and have done for years.

 

Cheers. John.

Edited by AussieJohn
Link to comment
Share on other sites

From the console I use:

 

du -sh `ls`

 

for example, if I was in /home/username at the time, I would see the total size for Documents, Downloads, Music, etc, etc. The -sh for du command gives summary and human readable format of directory sizes from the directory listing provided by the command ls. The single angled quote is important.

Link to comment
Share on other sites

Here's a bash script I either wrote or picked up somewhere a long time ago that will give the directory size in bytes of the current directory:

 

#!/bin/bash

## Script gives size of current directory in Bytes when executed

let TotalBytes=0

for Bytes in $(ls -laR | grep "^-" | awk '{ print $5 }')
do
  let TotalBytes=$TotalBytes+$Bytes
done

echo  "${TotalBytes}"

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...