General: added listing file/folder sizes

master
Eirik Th S 2020-07-02 11:19:27 +02:00
parent 70ff1a4af6
commit 79452b6dfd
1 changed files with 13 additions and 1 deletions

View File

@ -4,10 +4,22 @@
Create directory recursivly: `mkdir -p these/folders/doesnt/exist`
> -p for "parent"
<br>
List directory sorted by file-size: `ls -lhS /path`
> -S sorts them. -lh gives a list with "human-readable" file-sizes.
> -S sorts them. -lh gives a list with "human-readable" file-sizes.
<br>
Find the size of each item in a folder: `du -sm *`
You can sort them by adding: `du -sm * | sort -nr`
> You can add `-h`, but it won't sort correctly
To find the largest 20 files in a directory:
> `du -ah ./ | sort -rh | head -20`
<br>
### Set script as startup
If, for some reason, apache isn't startup: