


Linux command manual view (linux view hard disk usage command)
php editor Xiaoxin introduces to you the command to check the hard disk usage in the Linux operating system. In Linux systems, we often need to understand the usage of hard disks in order to reasonably manage storage space. Fortunately, Linux provides some convenient and practical commands to check hard disk usage. Through these commands, you can easily understand the total capacity, used capacity, available capacity and other information of the hard disk, so that you can clean up and manage the space in a timely manner. Next, let's learn about these commands.
df comes from the coreutils software package and comes with it when the system is installed; we can use this command to check the disk usage and the location where the file system is mounted;
[root@localhost ~ ]# df -l
File system capacity used available used% mount point
/dev/sda3 4956316 3565088 1135396 76% /
tmpfs 241320 12 241308 1% /dev/shm
/ dev/sda6 4806904 2523708 2039012 56% /media/disk
/dev/sda1 4956284 3529796 1170656 76% /media/_
/dev/sda5 4845056 2581484 2019388 57% /media/disk-1
You can see that the system is hung on sda3, and there are also three systems hanging on sda6/sda1/sda5.
2. fdisk -l command
fdisk is a powerful disk operation tool from the util-linux software package. Here we only talk about how to view the disk partition table and partition structure; Through the -l parameter, you can obtain the partition status of all hard disks in the machine;
[root@localhost ~]# fdisk -l
Disk /dev/sda: 40.0 GB, 40000000000 bytes
255 heads, 63 sectors/track, 4863 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x62a9f8d0
Device Boot Start End Blocks Id System
/dev/sda1 * 1 637 5116671 83 Linux
/dev/sda2 638 891 2040255 82 Linux swap / Solaris
/dev/sda3 892 1528 5116702 83 Linux
/dev/sda4 1529 2744 9767520 5 Extended
/dev/ sda5 1529 2136 4883728 83 Linux
/dev/sda6 2137 2744 4883728 83 Linux
sda1 is the partition where the MBR (Master Boot Record) is located, sda2 is the swap partition, and sda4 is the extended partition, including sda5 and sda6 two logical partitions. When the system is divided into partitions, it can only be divided into four primary partitions (extended partitions are also considered primary partitions). In my setup, I divided 3 primary partitions and 1 extended partition, so numbers like sda1.2.3.4.5.6 appeared. If only one primary partition and one extended partition are divided, then the logical partition will start from sda5, followed by sda5.6.7...
3. cfdisk -Ps command (note that P is capitalized)
cfdisk is also a good partitioning tool; in some distributions, this tool has been removed from the util-linux package; cfdisk is simple and easy to use;
View the usage of disk partitions cfdisk -Ps disk device name You can also use cfdisk -Ps
if you have only one hard disk. Example 1: [root@localhost ~]# cfdisk -Ps
Partition Table for /dev/sda
First Last
# Type Sector Sector Offset Length Filesystem Type (ID) Flag
— ——- ————– ————– —— ————– ——————– ——————-
1 Primary 0 10233404 63 10233405 Linux (83) Boot
2 Primary 10233405 14313914 0 4080510 Linux swap / So (82) None
3 Primary 14313915 24547319 0 10233405 Linux (83) None
4 Primary 24547320 44082359 0 19535040 Extended ( 05) None
5 Logical 24547320 34314839 63 9767520 Linux (83) None
6 Logical 34314840 44082359 63 9767520 Linux (83) None
Logical 44082360 78124094 0 34041735 Free Space None
Example 2 :[root@localhost ~]# cfdisk -Ps /dev/sda
Partition Table for /dev/sda
First Last
# Type Sector Sector Offset Length Filesystem Type (ID) Flag
— ——- ————– ————– —— ————– ——————– —-
1 Primary 0 10233404 63 10233405 Linux (83) Boot
2 Primary 10233405 14313914 0 4080510 Linux swap / So (82) None
3 Primary 14313915 24547319 0 10233405 Linux (83) None
4 Primary 24547320 44082359 0 19535040 Extended (05) None
5 Logical 24547320 34314839 6 3 9767520 Linux (83) None
6 Logical 34314840 44082359 63 9767520 Linux (83) None
Logical 44082360 78124094 0 34041735 Free Space None
4. parted command
parted is a partitioning tool with good functions; in Fedora 8 There is a tape, you can install it yourself; the calling method is simple, the default device opened by parted is /dev/hda, you can also specify it yourself; such as parted /dev/hda or /dev/sda, etc.; the exit method is quit
It will take a while after entering the parted command before the following content will appear:
[root@localhost ~]# parted
GNU Parted 1.8.6
Use /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted)
Enter p under the cursor and press Enter. The following content will appear:
Model: ATA Maxtor 5T040H4 (scsi )
Disk /dev/sda: 40.0GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Number Start End S ize Type File system flag
1 32.3kB 5240MB 5239MB Primary partition ext3 boot
2 5240MB 7329MB 2089MB Primary partition linux-swap
3 7329MB 12.6GB 5240MB Primary partition ext3
4 12.6GB 22.6GB 10.0GB Extended partition
5 12.6 GB 17.6GB 5001MB Logical partition ext3
6 17.6GB 22.6GB 5001MB Logical partition ext3
(parted)
Enter quit after the cursor to exit.
5. sfdisk -l
[root@localhost ~]# sfdisk -l
Disk /dev/sda: 4863 cylinders, 255 heads, 63 sectors/track
Units = cylinders of 8225280 bytes, blocks of 1024 bytes, counting from 0
Device Boot Start End #cyls #blocks Id System
/dev/sda1 * 0 636 637- 5116671 83 Linux
/dev/sda2 637 890 254 2040255 82 Linux swap / Solaris
/dev/sda3 891 1527 637 5116702 83 Linux
/dev/sda4 1528 2743 1216 9767520 5 Extended
/dev/sda5 1528 2135 608 - 4883728 83 Linux
/dev/sda6 2136 2743 608- 4883728 83 Linux
6. You can also use Applications>System Tools>Disk Usage Analyzer to view disk usage
The above is the detailed content of Linux command manual view (linux view hard disk usage command). For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics











First download the latest Win11 system ISO image, and then in Win10 system, you can directly right-click on the downloaded ISO image file and select [Load]; if it is under WinPE, WinXP, or Win7 system, you need to use the virtual optical drive tool to load the ISO Image; or you can directly decompress the ISO image file without using a virtual optical drive. Then run WinNTSetup. The software interface is as shown in the figure: First locate the location of the install.wim file. You can find the install.wim file in the sources directory of the Win11 ISO image loaded or decompressed by the virtual optical drive. Then set the location of the boot disk and installation disk. Generally, you are going to put W

Baidu Netdisk download failed 125201 Error reason: Network problems: unstable/slow connection, router failure, busy server File problems: damaged/incomplete files, invalid links Baidu Netdisk restrictions: download limit exceeded, membership expiration/account restricted Browser/application issues: out-of-date version/poor compatibility, download manager failure System issues: viruses/malware, missing components/drivers

Tutorial on assembling a computer and installing a system? Nowadays, the system installation for assembling computers is very simple and convenient, and only requires a CD. First enter the bios settings, set the computer to boot first with the CD-ROM drive, then restart the computer and load the system CD into the CD-ROM drive. The CD will automatically enter the installation state. At this time, you only need to manually repartition the partitions, and the rest will be completed automatically. How to install win11 system when assembling a computer? 1. First, we need to download a win11 image file from this site before installing it. 2. The win11 image file has undergone a large number of professional tests to ensure stable installation and smooth operation. 3. After the download is completed, load the folder in the download path and run the "windowssetup" process in it.

How to enter bios after assembling a computer? Before entering the BIOS, you need to make sure that the computer is completely shut down and powered off. Here are several common ways to enter the BIOS: 1. Use shortcut keys: Most computer manufacturers will display a prompt message at startup telling you which key to press to enter the BIOS settings. Usually the F2, F10, F12 or Delete key. After pressing the appropriate keys, you should be able to see a screen with information about your computer's hardware and BIOS settings. 2. Use the button on the motherboard: Some computer motherboards have a dedicated button for entering BIOS settings. This button is usually labeled "BIOS" or "UEFI". After pressing the button you should be able to see

How to flash the Windows system on BBK tablet? The first way is to install the system on the hard disk. As long as the computer system does not crash, you can enter the system and download things, you can use the computer hard drive to install the system. The method is as follows: Depending on your computer configuration, you can install the WIN7 operating system. We choose to download Xiaobai's one-click reinstallation system in vivopad to install it. First, select the system version suitable for your computer, and click "Install this system" to next step. Then we wait patiently for the installation resources to be downloaded, and then wait for the environment to be deployed and restarted. The steps to install win11 on vivopad are: first use the software to check whether win11 can be installed. After passing the system detection, enter the system settings. Select the Update & Security option there. Click

1. First we need to download the win11 image file. 2. Put the downloaded win11 image into another disk. 3. Then we find the win11 image file among the searched image files. 4. Then when we come to this interface, we select install.wim to proceed to the next step. 5. Then select the Windows 11 system and click OK to restore the image file. 6. Then we wait for pe to download and install. Wait patiently. After the download is completed, click restart according to the prompts. 7. Then come to this interface, we select the second xiaobaiPE. After selecting, the win11 system will be automatically installed for us. After the installation is completed, click to restart the computer immediately according to the prompts. 8. Finally, the system installation is completed, and we come to

Reinstalling the system is a problem that many computer users often encounter. Whether it is due to system crash, poisoning or wanting to upgrade the system, reinstalling the system is a good choice. However, many people encounter various problems when reinstalling the system, such as not knowing how to set up the BIOS, not knowing how to choose a suitable installation disk, etc. Today, we will talk about some things you must know when reinstalling the system from a USB flash drive, and teach you how to set up the BIOS correctly and successfully complete the system reinstallation. Tool materials: System version: Windows1020H2 Brand model: Lenovo Xiaoxin Air14 Software version: Pocket machine One-click reinstallation of system software v1.0 1. Preparation 1. Prepare a U disk with a capacity of no less than 8GB, preferably USB3. 0, so the speed will be faster

Does the newly assembled computer keyboard light not light up? The motherboard model should be UEFIbios. First find a keyboard with PS2 port, enter bios, turn off UEFI boot, and change to Legacy mode. If there is fast boot, turn off options like FastBoot, UEFI boot, turn on fast boot, and enter the system. USB interface detection may be turned off before, and USB devices can be used to assemble the computer after entering the system. The mouse and keyboard lights do not light up when the computer is turned on? If the keyboard light does not come on, there is a high possibility of memory failure, or it may be caused by static electricity on the motherboard or the motherboard is faulty. Use an eraser to wipe the gold finger of the memory graphics card, and remove and insert the memory several times. The problem remains. There are dual memory sticks and a single memory stick is used for testing. The problem persists. Re-plug the various cables inside and outside the chassis, and then unplug the connector on the motherboard.
