DeveloperBreeze

How to view free space on a Linux server

df -h

Explanation:

  • df: This command stands for "disk free" and reports the amount of disk space used and available on Linux filesystems.
  • -h: This option stands for "human-readable" format, which makes the output easier to read by showing sizes in KB, MB, GB, etc.

Sample Output:

When you run the df -h command, you might see output similar to the following:

Filesystem      Size  Used Avail Use% Mounted on
/dev/sda1        40G   25G   15G  63% /
udev            1.9G     0  1.9G   0% /dev
tmpfs           384M  1.2M  383M   1% /run
/dev/sda2       100G   50G   50G  50% /home

Additional Tips:

  • Specific Filesystem: To view the space for a specific filesystem, add its path at the end of the command, like so:
  df -h /home
  • Inodes: To check free inodes instead of disk space, use the -i option:
  df -i

Related Posts

More content you might like

Tutorial
bash

How to Reset the MySQL Root Password Using DROP USER

Now that MySQL is running in "safe mode" without requiring passwords, you can log in without being prompted for the root password.

mysql -u root

Oct 03, 2024
Read More
Tutorial

Getting Started with FFmpeg

On macOS, you can install FFmpeg using Homebrew.

   /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Aug 21, 2024
Read More
Tutorial

How to Install an AppImage on Linux

Now that the AppImage is executable, you can run it directly from the terminal or by double-clicking on it in your file manager.

   ./exampleName.AppImage

Aug 21, 2024
Read More
Tutorial
bash

Finding the Top 10 Biggest Files on an Ubuntu Server

1.2G    /var/log/largefile.log
900M    /home/user/bigdata.dat
850M    /opt/application/hugefile.bin
...

If you're interested in both files and directories, you can use the du command:

Aug 11, 2024
Read More

Discussion 0

Please sign in to join the discussion.

No comments yet. Be the first to share your thoughts!