Common Linux commands (disk management)

Source: Internet
Author: User
Tags disk usage
Common Linux commands (disk management)-General Linux technology-Linux technology and application information. For details, refer to the following section. Df command

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.


Du command

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 ).

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
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.