how to check disk space in linux

Checking Disk Space in Linux

To check the disk space in Linux, you can use the df command. Here are the steps to do it:

  1. Open a terminal: Press Ctrl + Alt + T to open a terminal window. This will provide you with a command-line interface to execute commands.

  2. Run the df command: Type df in the terminal and press Enter. This command stands for "disk free" and displays information about the disk space usage on your system.

  3. Interpret the output: The df command will display information about each mounted file system, including the total size, used space, available space, and the mount point. Here's an example of the output:

Filesystem 1K-blocks Used Available Use% Mounted on /dev/sda1 10239872 3456784 6789088 34% / /dev/sdb1 20480000 6789088 13690912 25% /mnt/data

  • The first column, Filesystem, shows the device or partition name.
  • The second column, 1K-blocks, displays the total size of the file system in kilobytes.
  • The third column, Used, indicates the amount of disk space used.
  • The fourth column, Available, shows the amount of disk space available.
  • The fifth column, Use%, represents the percentage of disk space used.
  • The last column, Mounted on, displays the mount point of the file system.

Note: The sizes are displayed in kilobytes by default. You can use the -h option with the df command (e.g., df -h) to display the sizes in a more human-readable format, such as gigabytes (GB) or megabytes (MB).

That's it! You have successfully checked the disk space in Linux using the df command.

[1]