Read free space in Ubuntu via SSH (SSH, 2023, df)

Marc Wagner, March 20, 2023

Storage space on your computer is a limited resource that can sometimes run out, especially if you store a lot of files and applications. Therefore, it is important to monitor the available space on your system to make sure you have enough storage for important files and applications. Ubuntu is a popular operating system used on many computers, and there are several methods to monitor the available disk space on your Ubuntu system. In this blog post, we will show you how to read free space in Ubuntu.

Syntax description for use in the shell #

A short syntax description for using the command (df) in the shell (SSH):

df OPTION DATEI

OPTION and FILE are optional parameters

Examples of the “df” console command #

“df” is a command in the Unix and Linux operating system environment used to display information about storage capacity and usage on a file system. The name “df” stands for “disk free” and indicates how much disk space is still available on a particular file system.

Open a connection to your server via SSH with a terminal (e.g. putty) and enter the following line:

# Anzeigen des Speicherplatzes
df

# Lesbares Format, -h steht für --human-readable
df -h

# Informationen über eine Partition anzeigen, auf der sich die Datei "placeholder.png" befindet
df -h placeholder.png

After entering the command, you will get a display similar to the following image:

image
Example df -h on Ubuntu with a default block size of 1,000,000

Options / parameters #

Short formLong formDescription
-a–allInclusion of all file systems
-B 10–block-size=10Specification of the block size, 100.000 = 100kB
-h–human-readableOutput in a readable format
-i–inodesListing of INODE information
-kSetting the block size to 1k
-l–localShow local file systems only
-t–type=TYPConsider only file systems of type TYPE
-T–print_typeOutput file system type
-x–exclude-type=TYPConsider all file systems except those of type TYPE
Avatar of Marc Wagner
Marc Wagner

Hi Marc here. I'm the founder of Forge12 Interactive and have been passionate about building websites, online stores, applications and SaaS solutions for businesses for over 20 years. Before founding the company, I already worked in publicly listed companies and acquired all kinds of knowledge. Now I want to pass this knowledge on to my customers.

Similar Topics

Comments

Leave A Comment