Merge remote-tracking branch 'refs/remotes/origin/main'

This commit is contained in:
Ze'ev Schurmann 2023-11-03 20:41:59 +02:00
commit 6d253fd513
1 changed files with 43 additions and 0 deletions

43
dirsize/README.md Normal file
View File

@ -0,0 +1,43 @@
# dirsize
This tool will scan the current folder and then calculate the total size of each folder within the current folder. It can take some time depending on the size.
It is very useful when trying to work out what is taking up all the storage capacity on a server.
If you run it in / you will get some errors as some folders have objects that are not files or folders and thus cannot be measured. Just ignore them as they are not critical. Also note that some folders you will need root access to calculate them. Alternatively you can use sudo.
## Setup
Make the file executable by using...
```
chmod +x dirsize.sh
```
Then either as root copy it to the /usr/bin folder without the .sh extension...
```
cp dirsize.sh /usr/bin/dirsize
```
or using sudo
```
sudo cp dirsize.sh /usr/bin/dirsize
```
## Example usage
```
root@zeevs:/var# dirsize
4.0K ./mail
32M ./spool
139M ./cache
349M ./lib
6.2M ./backups
959M ./log
4.0K ./opt
4.0K ./local
56K ./tmp
```