I…………

First, view the capacity of the disk or directory

1, for generating a command df see Oh mounted times by the total capacity, used capacity, remaining capacity, etc., may be without any parameters, the default display in KB

 

  -i: View express usage indoes (bottom filter out the relevant tmpfs partition)

 

 

 -h: use appropriate display unit (FIG filter out the relevant partition tmpfs)

 

 -k: tables are displayed in units of KB (FIG filter out the relevant partition tmpfs)

 

 -m: expressed in MB display (FIG filter out the relevant partition tmpfs)

 

 2, the command du: to see the size of a directory or file space occupied

                 -a: represents the total size of the files and directories are listed, if the latter without any options and parameters, lists only the size of the directory (including subdirectories), if the du command not specify a unit, then the default display unit is " KB "

 

                 -b: B represents the values ​​listed in units of output

                 -k: output expressed in kilobytes (KB), which is the default, and without any output value of the options is the same

                 -m: output expressed in MB

                 -h: a system adjustment unit automatically

 

 (If the file is too small, it may be several kilobytes, show it in KB; if the file size to gigabytes in GB on display, if a file is smaller than 4KB, when -k option, also displays 4KB, there will be a similar problem using -m)

                 -c: indicates the last sum

 

                -s: represents the sum of the values ​​listed (common)

 

 Second, the disk partitioning and formatting

3, the command fdisk: only the zoning of less than 2TB

                  -l: back without the device name, will directly list all the disk devices and partition tables; plus the device name, partition table of the device will be listed

 

 After the fdisk without -l, will enter another mode, the disk can be partitioned to operate in this mode

 

 

a 设置可引导标记(活动分区/引导分区之间切换)
b 编辑BSD磁盘标签
c 设置DOS操作系统兼容标记(兼容/不兼容之间切换)
d 删除一个分区
l 显示已知的分区类型,其中82为Linux swap分区,83为Linux分区
m 显示帮助信息
n 增加一个新的分区
o 创建一个新的空白的DOS分区表
p 显示磁盘当前的分区表
q 退出fdisk程序,不保存任何修改
s 创建一个新的空白的Sun磁盘标签
t 改变一个分区的系统ID,就是改变分区类型(比如把Linux Swap分区改为Linux分区)
u 改变显示或输入单位
v 验证磁盘分区表
                           w 将分区表写入磁盘并退出(保存并退出)
                           x 额外功能(专家级)
4,parted
Help Options
-h, --help          显示此求助信息 
-l, --list          列出所有设别的分区信息
-i, --interactive   在必要时,提示用户 
-s, --script        从不提示用户 
-v, --version       显示版本
操作命令:
cp [FROM-DEVICE] FROM-MINOR TO-MINOR      #将文件系统复制到另一个分区 
help [COMMAND]                            #打印通用求助信息,或关于 COMMAND 的信息 
mklabel 标签类型                           #创建新的磁盘标签 (分区表) 
mkfs MINOR 文件系统类型                     #在 MINOR 创建类型为“文件系统类型”的文件系统 
mkpart 分区类型 [文件系统类型] 起始点 终止点   #创建一个分区 
mkpartfs 分区类型 文件系统类型 起始点 终止点   #创建一个带有文件系统的分区 
move MINOR 起始点 终止点                    #移动编号为 MINOR 的分区 
name MINOR 名称                            #将编号为 MINOR 的分区命名为“名称” 
print [MINOR]                              #打印分区表,或者分区 
quit                                       #退出程序 
rescue 起始点 终止点                         #挽救临近“起始点”、“终止点”的遗失的分区 
resize MINOR 起始点 终止点                   #改变位于编号为 MINOR 的分区中文件系统的大小 
rm MINOR                                   #删除编号为 MINOR 的分区 
select 设备                                 #选择要编辑的设备 
set MINOR 标志 状态                          #改变编号为 MINOR 的分区的标志

Guess you like

Origin www.cnblogs.com/lzp123/p/12035689.html
I
"I"
I: