General: added listing file/folder sizes
parent
70ff1a4af6
commit
79452b6dfd
14
linux.md
14
linux.md
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue