Linux software package command Operating System

Source: Internet
Author: User

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;

 
 
  1. [Root @ localhost ~] # Df-l
  2. File System capacity used available % mount point
  3. /Dev/sda3 4956316 3565088 1135396 76%/
  4. Tmpfs 241320 12 241308 1%/dev/shm
  5. /Dev/sda6 4806904 2523708 2039012 56%/media/disk
  6. /Dev/sda1 4956284 3529796 1170656 76%/media /_
  7. /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;

 
 
  1. [root@localhost ~]# fdisk -l   
  2.  
  3. Disk /dev/sda: 40.0 GB, 40000000000 bytes   
  4. 255 heads, 63 sectors/track, 4863 cylinders   
  5. Units = cylinders of 16065 * 512 = 8225280 bytes   
  6. Disk identifier: 0x62a9f8d0   
  7.  
  8. Device Boot      Start         End      Blocks   Id System   
  9. /dev/sda1   *           1         637     5116671   83 Linux   
  10. /dev/sda2             638         891     2040255   82 Linux swap / Solaris   
  11. /dev/sda3             892        1528     5116702+ 83 Linux   
  12. /dev/sda4            1529        2744     9767520    5 Extended   
  13. /dev/sda5            1529        2136     4883728+ 83 Linux   
  14. /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

 
 
  1. Example 1: [root @ localhost ~] # Cfdisk-Ps
  2. Partition Table for/dev/sda
  3. First Last
  4. # Type Sector Offset Length Filesystem Type (ID) Flag
  5. ---------------------------------------------------------------------------
  6. 1 Primary 0 10233404 63 10233405 Linux (83) Boot
  7. 2 Primary 10233405 14313914 0 4080510 Linux swap/So (82) None
  8. 3 Primary 14313915 24547319 0 10233405 Linux (83) None
  9. 4 Primary 24547320 44082359 0 19535040 Extended (05) None
  10. 5 Logical 24547320 34314839 63 9767520 Linux (83) None
  11. 6 Logical 34314840 44082359 63 9767520 Linux (83) None
  12. Logical 44082360 78124094 0 34041735 Free Space None

Example 2: [root @ localhost ~] # Cfdisk-Ps/dev/sda

 
 
  1. Partition Table for /dev/sda   
  2.  
  3.                First       Last   
  4. # Type       Sector      Sector   Offset    Length   Filesystem Type (ID) Flag   
  5. -- ------- ----------- ----------- ------ ----------- -------------------- ----   
  6. 1 Primary           0    10233404     63    10233405 Linux (83)           Boot   
  7. 2 Primary    10233405    14313914      0     4080510 Linux swap / So (82) None   
  8. 3 Primary    14313915    24547319      0    10233405 Linux (83)           None   
  9. 4 Primary    24547320    44082359      0    19535040 Extended (05)        None   
  10. 5 Logical    24547320    34314839     63     9767520 Linux (83)           None   
  11. 6 Logical    34314840    44082359     63     9767520 Linux (83)           None   
  12.    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:

 
 
  1. [Root @ localhost ~] # Parted
  2. GNU Parted 1.8.6
  3. Use/dev/sda
  4. Welcome to GNU Parted! Type 'help' to view a list of commands.
  5. (Parted)

Enter p at the cursor and press enter to display the following content:

 
 
  1. Model: ATA Maxtor 5T040H4 (scsi)
  2. Disk/dev/sda: 40.0 GB
  3. Sector size (logical/physical): 512B/512B
  4. Partition Table: msdos
  5.  
  6. Number Start End S ize Type File system flag
  7. 1 32.3kB 5240 MB 5239 MB primary partition ext3 start
  8. 2 5240 MB 7329 MB 2089 MB primary partition Linux-swap
  9. 3 7329 MB 12.6 GB 5240 MB primary partition ext3
  10. 4 12.6 GB 22.6 GB 10.0 GB extended partition
  11. 5 12.6 GB 17.6 GB 5001 MB logical partition ext3
  12. 6 17.6 GB 22.6 GB 5001 MB logical partition ext3

(Parted) Enter quit behind the cursor to exit.

V. sfdisk-l

 
 
  1. [root@localhost ~]# sfdisk -l   
  2. Disk /dev/sda: 4863 cylinders, 255 heads, 63 sectors/track   
  3. Units = cylinders of 8225280 bytes, blocks of 1024 bytes, counting from 0   
  4.    Device Boot Start     End   #cyls    #blocks   Id System   
  5. /dev/sda1   *      0+    636     637-   5116671   83 Linux   
  6. /dev/sda2        637     890     254    2040255   82 Linux swap / Solaris   
  7. /dev/sda3        891    1527     637    5116702+ 83 Linux   
  8. /dev/sda4       1528    2743    1216    9767520    5 Extended   
  9. /dev/sda5       1528+   2135     608-   4883728+ 83 Linux   
  10. /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.

  1. In-depth understanding of Linux software package configuration, compilation, and installation
  2. Linux init process and related files
  3. Detailed analysis of ten aspects of Linux Server Security Protection
  4. Linux telnet checks whether the rpm package is installed with OS: RedHat9
  5. Install and debug Linux SkyEye open-source software

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.