Linux Disk Management commands

Source: Internet
Author: User
Tags bz2 gz file uuid disk usage

Manage Commands Ln, DF, Du, Mknod, Fdisk, Partprobe, Partx, Mkfs, Blkid, E2label, TUNE2FS, DUMPE2FS, fsck

LN Create a linked file or directory

-S Create soft links

-V Show verbose process

DF View disk information

-H Humanistic Reading mode

-I display i-nodes usage

- t file system type

du queries the disk usage space of the archive or directory

- H humanistic reading mode

-S only shows the sum of each file size (summarize)

mknod Create a directory entry and a special file corresponding to the index node the file has three B: Block device C: Character device P: Pipe file

-m setting default permissions for newly created files

-C, B, p create B: Block device C: Character device P: Pipe file

fdisk is a program that creates and maintains partitioned tables

-l list all partition tables

Partprobe

Used to reread a partitioned table (when a file is deleted, it still takes up space.) Can partprobe the partition without restarting)

-D does not update the kernel

-S Display partition information

The partx command is used to sue the partition of the kernel's current disk.

partx [-a|-d| -l] [--type  type "[-- nr  m-n "[ p Artition disk

-A add partition or read disk new partitions

-D Delete the established or all partitions

-L list Partitions

--TYPE specifies the partition type. Dos,bsd,solaris,unix, or GPT

--nr M-n specifying a partition range

Note

Cat/proc/partitons viewing the kernel system partition table

Cat/proc/filesystems View the file systems supported by the current kernel

mkfs Creating a file system

-t specifies that the file system type created defaults to ext2 (equivalent to the MKFS.EXT2 command)

-V provides verbose output information

blkid Viewing disk device related properties (UUID, TYPE, LABEL)

-S < tags > display specified label information (label, UUID, TYPE)

-O < tags > Specify output format (full, value, List\device\udev)

E2label User View or Define volume label (label)

tune2fs Adjusting the file system's related properties

-j does not damage the original data, upgrade the ext2 to Ext3

-l label to set or modify a volume label

-M #调整磁盘预留百分比

-R #指定预留块数

-O Set default mount options (ACL)

-C # Specifies that the mount count reaches # times after self-test, 0 or 1 means turn off this feature

-I #每挂载使用多少天后进行自检, 0 or 1 means turn off this feature

-l display information in the Super block

dumpe2fs displaying file property information

-H displays only the Super block information

fsck checks and repairs Linux file system

-tfstype specifying the file system type

-A non-interactive mode, automatic repair

-R Interactive Mode

-F Force Process check

-V displays detailed processing information

Mount

Mount Device mount point

Equipment:

Device file/DEV/SDB1

Volume Label: label= ""

Uuid:uuid= ""

mount point: Directory

Requirements:

1. This directory is not used by other processes

2, directory to exist

3. The original files in the directory will be temporarily hidden.

Mount: Displays devices and mount points that are already mounted on the current system

mount [Options] [-o options] DEVICE mount_point

-A: Indicates that all file systems defined in the/etc/fstab file are mounted

-N: By default, the Mount command saves the mounted device information to the/etc/mtab file each time a device is mounted, and using the-N option means that information is not written to this file when the device is mounted

-T Fstype: Specifies the type of file system on which the device is being mounted, and if this option is not available, Mount invokes the Blkid command to obtain the type of the corresponding file system

-r: Mount file read-only

-W: Read-write Mount

-O: Specify additional mount options, which specify the properties that the file system enables

Remount: Re-mount the current file system

Loop: Used to mount a file as a disk partition attached to the system (often used to mount image files)

RO: Read-only Mount

RW: Read-write Mount

Sync: Synchronous (Async asynchronous disk writes are asynchronous writes)

umount downloading a file system

Umount Equipment

Umount mount point

Uninstallation considerations: mount points are not in use state

Virtual address, linear address

Swap partition:

Mkswap Creating a Swap partition

-llabel

swapon Enable swap partition

-A enable all switching devices

-S view

Swapoff closing the swap partition

Loopback device: Loopback uses software to simulate hardware implementation

DD is used to copy files and convert and format the contents of the original file.

if= data source represents input file

of= data storage target represents output file

Bs= bytes represents the block size of the byte unit

Count represents the number of blocks being copied

/etc/fstab file Description: When the OS is initialized, it automatically mounts each file system defined in the/etc/fstab file

Uuid=e5e09ac9-f2b2-49bc-9903-97eaeda662ec/boot XFS Defaults 0 0

UUID=ED49E598-D50D-4367-9077-DFE19DBA5B72 swap swap defaults 0 0

1. Device to mount (UUID, device name, LABEL)

2, Mount point

3. File type

4. Mount option

5, dump frequency every few days do a full backup (0 means no backup, 1 means daily, 2 means backup every two days)

6, File system detection sequence (only the root can be 1,0 to indicate no check)

Fuser files and network sockets used for reporting processes

-V View the running process on the specified file

-K kills all processes that access the specified file

-m specifies a loaded file system or a loaded block device

Compress, unzip command

Compact format: GZ, bz2, XZ, zip, Z,

Compression algorithm: Different algorithm, compression ratio will also be different

gzip, bzip2, XZ perform compression does not retain the original file, extract delete original file, cannot compress the directory

Compress FILENAME.Z file format

Uncompress

gzip(fileame.gz file format)

Gzip/path/to/somefile

-D Decompression =gunzip

-# 1-9 Specifies the compression ratio, the default is 6

Gunzip

Gzip/path/to/somefile.gz

zcat View the contents of the compressed file (without pressure, view the contents of the text file)

bzip2 FILENAME.BZ2 file format

-D Decompression

-# 1-9 Specifies the compression ratio, the default is 6

-K Keep the original file when compressing

bunzip2 Unzip the bzip2 command compressed file

bzcat View text file contents when not under pressure

XZ Filename.xz

-D Decompression

-# 1-9 Specifies the compression ratio, which defaults to 6

unxz Decompression of XZ compressed files

xzcat Viewing compressed file contents

Zip (Can compress the directory, compression does not delete the original file, both archived and compressed tools)

Zipfilename.zipfile1 FILE2 ....

Unzip extracting zip compressed files

Tar Archive tool does not delete original file

-C Create an archive file

-F File.tar Operation archive file

-X Expand Archive file

Preserve extended attribute information for files when--xattrs archive

-T does not expand the archive and directly view which files are archived

-V shows the command execution process

-ZCF Create archive and gzip compress-ZXF call gzip unzip and expand archive (decompression can automatically determine the compression mode, so-Z can be omitted)

-JCF Create archive and BIZ2 compression-JXF call bzip2 extract and expand archive

-JCF Create archive and XZ compress-JXF call ZX Unzip and expand archive

cpio Archive Tool

Read reads the value of a variable from the keyboard and is typically used in a shell script to interact with the user.

-p Specifies the prompt to read the value

-t specifies the time to wait when reading a value


Linux Disk Management commands

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.