Brief Introduction to Linux disk management commands and terminologies

Source: Internet
Author: User

In the Liunx system, how to effectively use and manage buckets is a very important technology. This article focuses on Linux disk management commands, such as df, du, dd, and dfformat.

Disk Space Management

System software and application software must be stored in the disk space of a computer in the form of files. Therefore, the disk space usage should be monitored at any time. Linux provides a set of commands for disk space management.
◆ Disk management command: df command
◆ Function: Check disk space usage of the file system. You can use this command to obtain the space occupied by the hard disk and the remaining space.
◆ Syntax: df [Option]
◆ Note: the df command displays the I node and disk block usage of all file systems.

The meaning of each option of this command is as follows:
-A: displays the disk usage of all file systems, including 0 blocks.
-K is displayed in k bytes.
-I: displays the I node information instead of the disk block.
-T: displays the disk space usage of each specified type of file system.
-X lists the disk space usage of a file system of a specified type, which is different from that of the t option ).
-T displays the file system type.
Column 1st of the output list of the df command indicates that the path name of the device file corresponding to the file system is generally the partition on the hard disk); Column 2nd shows the number of data blocks containing 1024 bytes; column 3 and 4 indicate the number of used and available data blocks, respectively. The user may be surprised that the sum of the blocks in column 3 and 4 is not equal to the number of blocks in column 3. This is because by default, each partition leaves a small amount of space for the system administrator to use. Even if the common user space is full, the administrator can still log on and leave the workspace required to solve the problem. The Use % column in the list indicates the percentage of space used by normal users. Even if the number reaches 100%, the partition still has space for the system administrator. Finally, the Mounted on column indicates the Installation Point of the file system.
◆ Disk management command: the original English meaning of the du command is "disk usage", which means to display the usage of disk space.
◆ Function: calculates the disk space occupied by directories or files.
◆ Syntax: du [Option] [Names…]
◆ Note: This command step by step enters each sub-directory of the specified directory and shows that the directory occupies 1024 bytes of the data block of the file system. If no Names is provided, the current directory is counted.
The options of this command are as follows:
-S indicates the total number of data blocks occupied by each Names parameter.
-A Recursively displays the number of data blocks occupied by each file in the specified directory and its descendants. If neither-s nor-a is specified, only the disk blocks occupied by each directory and Its subdirectories in Names are displayed.
-B lists disk space usage in bytes. The system defaults to k Bytes ).
-K lists the disk space usage in 1024 bytes.
-C is followed by a total system default setting ).
-L calculate the size of all files, and calculate hard-linked files multiple times.
-X skipping directories on different file systems is not counted.
The following is an example of the use of the du command:

Disk operation
◆ Disk management command: dd command
◆ Function: copy the specified input file to the specified output file, and convert the format during the copy process. You can use this command to implement the diskcopy command in DOS. Use the dd command to write the data on the floppy disk as a storage file on the hard disk, and then write the storage file to the second disk to complete the diskcopy function. Note that you should delete the storage file on the hard disk with the rm command. Standard input files and standard output files are used by default.
◆ Syntax: dd [Options]
If = input file or device name ).
Of = output file or device name ).
Ibs = bytes: the number of bytes read from the buffer zone.
Skip = blocks skip the ibs * blocks block at the beginning of the read buffer.
Obs = bytes: the number of bytes written to the buffer zone.
Bs = bytes: set the number of bytes in the read/write buffer at the same time to set ibs and obs ).
Cbs = byte: bytes are converted once.
Count = blocks only copies the input blocks block.
Conv = ASCII converts the EBCDIC code to the ASCIl code.
Conv = ebcdic converts an ASCIl code to an EBCDIC code.
Conv = IBM converts an ASCIl code to an alternate EBCDIC code.
Conv = block converts a variable bit to a fixed character.
Conv = ublock converts a fixed bit to a variable bit.
Conv = ucase converts lowercase letters to uppercase letters.
Conv = lcase converts uppercase letters to lowercase letters.
Conv = notrunc: the output file is not truncated.
Conv = swab exchange each pair of input bytes.
Conv = do not stop processing when noerror occurs.
Conv = sync adjusts the size of each input record to the ibs size and fills it with NUL ).
◆ Disk management command: fdformat command
Floppy disk is a common storage medium. A floppy disk must be formatted before it can be used. Then, you can use commands such as tar, dd, and cpio to store data, or you can create an installable file system on a floppy disk.
◆ Function: low-level formatting floppy disk
◆ Syntax: format [-n] device
◆ Note: this command is used to format a floppy disk.

-N the disk is not verified after being formatted.
Device specifies the device to be formatted. It is usually one of the following devices:
/Dev/fd0d360
/Dev/fd0h1200
/Dev/fd0D360
/Dev/fd0H360
/Dev/fd0D720
/Dev/fd0000020
/Dev/fd0h360
/Dev/fd0000020
/Dev/fd0H1440

  1. Handling of Linux VMware installation failure
  2. Open-source implementation of running applications in Linux Hadoop
  3. Linux CVS check whether xinetd is installed in the system
  4. Linux configuration files and user management related system files
  5. Full parsing of Linux File Types

Related Article

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.