The Linux software package is a commonly used software for computer players. Then I will study and study the Linux software package in depth. Here I will discuss with you how to use the Linux software package, hoping to help you.
I. df-lh command
Df comes from the coreutils software package and comes with it during system installation. We can use this command to view the disk usage and the location where the Linux software package file system is mounted;
- [Root @ localhost ~] # Df-l
- File System capacity used available % 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
We can see that the system is mounted on sda3, and sda6, sda1, and sda5 are also mounted.
Ii. fdisk-l command
Fdisk is a powerful disk operation tool from util-Linux software package. Here we only talk about how to view the disk partition table and partition structure. Through the-l parameter, the Linux software package can obtain all the hard disk partitions on 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; sda4 is the extended partition, including the sda5 and sda6 logical partitions. When the system divides partitions, only four primary partitions can be divided. The Extended partitions are also considered the primary partitions.) I divided three primary partitions and one Extended partition above, and 5.6 is the logical partition. So there will be sda1.2.3.4.5.6. If you only divide one primary partition and one extended partition, the logical partition starts from sda5, sda1.2.5.6...
3. cfdisk-Ps command note that P is in uppercase)
Cfdisk is also a good partitioning tool. In some releases, this tool has been removed from the util-Linux software package; cfdisk is simple and easy to use;
View disk partition usage cfdisk-Ps the disk device name has only one hard disk, you can also use cfdisk-Ps
- Example 1: [root @ localhost ~] # Cfdisk-Ps
- Partition Table for/dev/sda
- First Last
- # Type 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 63 9767520 Linux (83) None
- 6 Logical 34314840 44082359 63 9767520 Linux (83) None
- Logical 44082360 78124094 0 34041735 Free Space None
Iv. parted command
Parted is a good partitioning tool. It has a belt in Fedora 8 and can be installed by yourself. The Calling method is simple. By default, parted enables/dev/hda and can be specified by itself; for example, parted/dev/hda or/dev/sda. The exit method is quit.
Enter the parted command and the following content will appear later:
- [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 at the cursor and press enter to display the following content:
- Model: ATA Maxtor 5T040H4 (scsi)
- Disk/dev/sda: 40.0 GB
- Sector size (logical/physical): 512B/512B
- Partition Table: msdos
-
- Number Start End S ize Type File system flag
- 1 32.3kB 5240 MB 5239 MB primary partition ext3 start
- 2 5240 MB 7329 MB 2089 MB primary partition Linux-swap
- 3 7329 MB 12.6 GB 5240 MB primary partition ext3
- 4 12.6 GB 22.6 GB 10.0 GB extended partition
- 5 12.6 GB 17.6 GB 5001 MB logical partition ext3
- 6 17.6 GB 22.6 GB 5001 MB logical partition ext3
(Parted) Enter quit behind the cursor to exit.
V. 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 the Linux software package Application> System Tools> disk analyzer Linux software package to view disk usage.
- In-depth understanding of Linux software package configuration, compilation, and installation
- Linux init process and related files
- Detailed analysis of ten aspects of Linux Server Security Protection
- Linux telnet checks whether the rpm package is installed with OS: RedHat9
- Install and debug Linux SkyEye open-source software