Home > Operation and Maintenance > Linux Operation and Maintenance > What is the command to check disk space in Linux system

What is the command to check disk space in Linux system

王林
Release: 2022-12-30 11:12:16
Original
75846 people have browsed it

The command to check the disk space in Linux system is [df -hl]. This command can check the remaining space of the disk. If you want to check the partition size of each root path, you can use the [df -h] command. The df command views the file system in units of disk partitions.

What is the command to check disk space in Linux system

The operating environment of this article: red hat enterprise linux 6.1 system, thinkpad t480 computer.

(Learning video sharing: linux video tutorial)

Linux can use the df and du commands to check the disk space.

df command

df View the file system in units of disk partitions. You can obtain information such as how much space is occupied by the hard disk and how much space is currently left.

For example, we use the df -h command to view disk information. The -h option is to display appropriately according to the size:

What is the command to check disk space in Linux system

Related commands:

df -hl: Check the remaining disk space

df -h: Check the partition size of each root path

du command

du The original English meaning of du is disk usage , meaning to display disk space usage and used to view the total size of the current directory.

For example, check the size of the current directory:

# du -sh
605M    .
Copy after login

Display the space occupied by the specified file:

# du log2012.log 
300     log2012.log
Copy after login

Display the space occupied by the test directory in an easy-to-read format:

What is the command to check disk space in Linux system

Related recommendations: linux tutorial

The above is the detailed content of What is the command to check disk space in Linux system. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template