How to determine disk space usage?

To check what is taking up space on your server, you can run multiple commands -
  • You can use the du command 
    • du -kscx *
    • du -hc --max-depth=4 /dir | sort -h
    • du -sch *

  • Another option is to use the find command -
    • find /home/ -size +1073700000c -print

  • The following command will display all files and folders sorted by MegaBytes
    • du --max-depth=1 | sort -n | awk 'BEGIN {OFMT = "%.0f"} {print $1/1024,"MB", $2}'

  • Below is the "find"command that looks for specific files in the "home" directory. The following script is finding files that are 500000k or larger
    • find /home -type f -size +500000k -exec ls -lh {} \; | awk '{ print $9 ": " $5 }'
  • 0 Utenti hanno trovato utile questa risposta
Hai trovato utile questa risposta?

Articoli Correlati

How to disable SSH login for the root user?

To disable root login, open the main ssh configuration file /etc/ssh/sshd_config with your...

Connecting to your Linux VPS

Now you received your details you’ll connect to it via SSH if you have a Linux VPS: If your...

How to Install Linux Malware Detect?

Linux Malware Detect (LMD) is an excellent tool for detecting malware on linux operating system....