Linux Study notes third week fourth class (February 8)

Source: Internet
Author: User
Tags print print disk usage

4.1 DF Command


Df,report file system disk space usage reports the usage of the FileSystem disks;

DF command format: DF [option]

Df-a:all displays disk usage for all file systems, including 0 blocks of file systems.

Df-h:human readable output file system sizes in an easy-to-understand format, such as 124KB, 345MB, 46GB.

Df-i:inodes Displays the I node usage.

DF-M: Display file system usage in MB;


Df-t:type Displays disk space usage for each of the specified types of file systems.

Df-x:exclude type lists disk space usage for a file system that is not a specified type.

Df-t:print type Displays the file system types.

DF in 512-byte units

The df–k is in 1024-byte units.


View memory usage, command for #free;


4.2 du command


Du, view file directory size, file size;

View directory or file size common commands for #du-sh/root;

-S refers to the table of contents;-h,human human visualization is easier to understand;

View all files or directories under the directory size, command for #du/root;


4.3/4.4 Disk Partitioning


Add a new disk to the virtual machine, operation see Figure;

right mouse button CenOS7, click Settings, and then pop up the dialog box, click Add, select Hard disk, the next default, add complete, OK, complete the new disk Add, new add disk, virtual machine does not display, need to restart the virtual machine;


List disk Partitions #fdisk-L ;

Partition the new hard disk, the command is #fdisk/dev/sdb;

Common options,

N,new new Partition;

P,print print out the columns;

W,write write save and exit;

Q,quit does not save the exit;

D,delete Delete partition;

What to do, enter the corresponding letter, for example: Create a new extended partition, command;

Explanation: Fdisk supports up to 2T disks, the primary partition is up to 4, the extended partition can be divided into logical partitions, the number of primary partitions + extended partitions <=4; logical partitions must be contiguous, the primary and logical partitions can be formatted, the extended partition cannot be directly formatted, the extended partition is just a shell, Contains 1 or more logical partitions;


Linux Study notes third week fourth class (February 8)

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.