From ece27d9b7e0f95813ad8f2804287e0bfb309e4bf Mon Sep 17 00:00:00 2001 From: thisiszeev Date: Fri, 27 Oct 2023 11:04:08 +0200 Subject: [PATCH 1/2] Created README.md --- dirsize/README.md | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 dirsize/README.md diff --git a/dirsize/README.md b/dirsize/README.md new file mode 100644 index 0000000..9f35e67 --- /dev/null +++ b/dirsize/README.md @@ -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 +''' + From 06a34f315fe3e18edc63d051013c2ec81562c6ee Mon Sep 17 00:00:00 2001 From: thisiszeev Date: Fri, 27 Oct 2023 11:06:39 +0200 Subject: [PATCH 2/2] Update 'dirsize/README.md' --- dirsize/README.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/dirsize/README.md b/dirsize/README.md index 9f35e67..b3ce7e0 100644 --- a/dirsize/README.md +++ b/dirsize/README.md @@ -10,25 +10,25 @@ If you run it in / you will get some errors as some folders have objects that ar 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 +## Example usage -''' +``` root@zeevs:/var# dirsize 4.0K ./mail 32M ./spool @@ -39,5 +39,5 @@ root@zeevs:/var# dirsize 4.0K ./opt 4.0K ./local 56K ./tmp -''' +```