CityHost.UA
Help and support

Linux: Information about disk space on VDS/DS

When working with a virtual or dedicated server, sometimes there is a need to see disk space usage, this can be done in many ways. As part of this instruction, we will consider basic examples of viewing disk statistics using SSH or WEB-VNC protocols.

The df command

Information about free and occupied disk space.

 df -h

Information about free and used inodes.

 df -i

The ncdu utility

This utility is not standard and requires installation, but it allows you to quickly and easily get information about the occupied disk space. You can add a "/" character to the end of the command to display information from the root folder, otherwise the utility will display information about the folder you are currently in. Use the arrows and the Enter key to move between folders.

 ncdu /

Other teams

Display a list of folders with the largest disk consumption.

 du -h -d1 2>/dev/null | sort -h

Display a list of files and folders sorted by size.

 ls -alhSr

Count the inodes used by the directory (instead of /path/to/dir is the path to the directory).

 find /path/to/dir | wc -l

Utility mc

mc or Midnight Commander is a console file manager. With its help, you can see the file system of the server, move between directories, copy, move, delete files, etc.