How to query disk in linux

WBOY
Release: 2022-01-27 15:56:20
Original
6123 people have browsed it

In Linux, you can use the df command to query the disk. The function of this command is to display the file system disk usage statistics on the Linux system. When the parameter is set to "-h", the disk display format is easy Yes, the syntax is "df -h".

How to query disk in linux

#The operating environment of this tutorial: linux7.3 system, Dell G3 computer.

How to query the disk in Linux

The Linux df (full English spelling: disk free) command is used to display the current file system disk usage statistics on the Linux system.

Syntax

df [选项]... [FILE]...
Copy after login
  • File-a, --all Contains all file systems with 0 Blocks

  • File- -block-size={SIZE} Use {SIZE} size Blocks

  • file -h, --human-readable Use human-readable format (default value is not to add this Options...)

  • File -H, --si is like -h, but uses 1000 instead of 1024

  • File -i, --inodes List inode information, do not list used blocks

  • File -k, --kilobytes Just like --block-size=1024

  • File -l, --local Limit the listed file structures

  • File -m, --megabytes Like --block-size= 1048576

  • File--no-sync Do not sync before getting information (default value)

  • File-P, --portability use POSIX Output format

  • file--sync sync

  • file-t, --type=TYPE limit the list of file systems before obtaining information TYPE

  • File-T, --print-type Display the format of the file system

  • File-x, --exclude-type=TYPE Restrict listing of file systems to do not show TYPE

  • file -v (ignore)

  • ##file --help Show this helper and exit

  • File --version Output version information and exit

Instance

Display disk usage statistics of the file system:

# df Filesystem 1K-blocks Used Available Use% Mounted on /dev/sda6 29640780 4320704 23814388 16% / udev 1536756 4 1536752 1% /dev tmpfs 617620 888 616732 1% /run none 5120 0 5120 0% /run/lock none 1544044 156 1543888 1% /run/shm
Copy after login

The first column specifies the name of the file system, the second column specifies a specific file system 1K - blocks 1K is 1024 bytes of total memory. The used and available columns are in use, respectively, specifying the amount of memory.

Use columns to specify the percentage of memory used, while the last column "mounted on" specifies the mount point of the file system.

df can also display the file system information used by the disk:

# df test Filesystem 1K-blocks Used Available Use% Mounted on /dev/sda6 29640780 4320600 23814492 16% /
Copy after login
Related recommendations: "

Linux Video Tutorial"

The above is the detailed content of How to query disk in linux. 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
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!