Common commands for getting started with Linux-11. Linux disk management

Source: Internet
Author: User
Linux disk management

DFCommand

Function: Checks 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 block file systems, such as/proc file systems.

-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 (opposite to the T option ).

-T displays the file system type.

 

DuCommand

The original English meaning of DU 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 displays the directory's usage of File System data blocks (1024 bytes. 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.

 

Dd command

Function: Copies the specified input file to the specified output file, and supports format conversion 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 [Option]

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 (equal to setting 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 (filled with NUL ).

 

FdformatCommand

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

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.