Home >System Tutorial >LINUX >How to confirm the number of partitions in Linux system

How to confirm the number of partitions in Linux system

WBOY
WBOYOriginal
2024-03-01 10:51:041185browse

Determining the number of partitions in a Linux system is a common operation and can be confirmed in a variety of ways. This article will introduce several commonly used methods and provide specific code examples.

  1. Use the fdisk command:
    fdisk is a commonly used partition management tool that can be used to view the system’s disk partition information. The disk partition status of the current system can be listed through the following command:
sudo fdisk -l

After executing the above command, the system will list the detailed partition information of all disks, including partition size, file system type, etc. Through this command, you can clearly see the number of partitions in the system.

  1. Use the lsblk command:
    The lsblk command can list the block device information in the system, including the relationship between disks and partitions. You can check the number of partitions in the system through the following command:
lsblk

After executing the above command, the system will list the information of all block devices, including the partition structure. You can confirm the number of partitions in the system based on the output.

  1. Use the df command:
    The df command is used to check the disk space utilization of the file system. You can know the number of partitions in the system by checking the mount point. The following is an example command:
df -h

After executing the above command, the system will list the space usage of the current file system and display the mount point information. The mount points allow you to determine the number of partitions present in the system.

Through the above methods, you can confirm the number of partitions in the Linux system. In actual operation, you can choose a suitable method to view the partitioning of the system according to different needs.

The above is the detailed content of How to confirm the number of partitions in Linux system. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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