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

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
Hier klicken, um den Beitrag zu bewerten
[Gesamt: 0 Durchschnitt: 0]

Leave A Comment

Title