CentOS disk management commands
CentOS disk management commands
Df disk free
- Display disk Information
- Df [-aHhiklmPT] [-- block-sze = <block size>] [-t file system type] [-x file system type]
- Parameters:
- -A or all contains all file systems
- -H: display information in a readable manner
- -H or-si is the same as-h, but the calculation is 1024 bytes rather
- -I: displays iNode node information.
- -L only display the local file system
Dirs.
- Show directory records
- Parameters
- -L display directory completion records similar to pwd
Du disk usage
- Display directory or file size
- Parameters:
- -A: displays the file size in the directory.
- -B: the number of bytes of the displayed directory or file is large.
- -H: display information in a readable manner
- -M: displays information in MB.
Mkdir
- Create a directory and Set permissions
- Parameters:
- -M: notifies you To Set directory permissions when creating directories.
- -P recursively create a directory
Mount
- Interpret the content of an archive into an archive system, and then place it on a location in the directory.
- -V: display the program version
- -H: displays auxiliary information
- -V displays the proofreading information, which is usually used with-f for debugging.
- -F is usually used with-a. It will generate a route for each mount action. The responsible system can speed up mounting when a large number of NFS file systems need to be mounted.
- -T specifies the type of the file system, which is usually not required. Mount automatically selects the correct type.
- -O remount: remount a mounted file system in different ways
- Example
- Mount/dev/hda1 in read-only mode under/mnt
- # Mount-o ro/dev/hda1/mnt
Pwd
- Display working directory
Quota
- Displays the space used by the disk and its limits.
- Run this command to check the new disk space limit and used space.
- Parameters
- -G: list the group quota.
- -Q: only list the parts that exceed the limit.
- -U: list the disk space limits of users.
- -V displays the quota of storage devices attached to all systems by users or groups.
Quotacheck
- Check disk space and restrictions
- After executing this command, the system scans the mounted partitions and generates quota. user and quota. group in the file system of each partition. Set the disk quota for users and groups.
Quotaoff
- Disable Disk Quota
- Run this command to disable the disk quota of users and groups.
- Syntax: quotaoff [-aguv] [file system...]
- Parameters:
- -A: Disable all partitions added with the quota settings in fstab.
- -G: Disable the disk quota of the group.
- -U: Disable the user's disk quota.
Quotaon
- Enable disk space limit.
- Quotaon [-aguv] [file system...]
- Parameters:
- -When a is enabled in the/ect/fstab file, the partition space added to the quota settings is limited.
- -G: Enable the disk space limit of the group.
- -U enables the user's disk space limit.
Repquota
- Check the disk quota limit status
- Repquota [-aguv] [file system...]
- Execute the repquota command to report disk space restrictions and clearly know how much space each user or group has used.
- Parameters:
- -A is listed in the/etc/fstab file, which shows the usage of partitions added to the quota settings, including users and groups.
- -G lists the disk space limits of all groups.
- -U: list the disk space limits of all users.
Edquota
- Edit the quota of a user or group.
- Edquota [-p <source User Name>] [-ug] [user or group name...]
- By default, edquota uses vi to edit the quota settings of users or groups.
- Parameters:
- -U sets the user's quota, which is a preset parameter.
- -G: set the quota of the group.
- -P <source User Name> applies the quota settings of the source user to other users or groups.
- -T: Set the grace period.
Stat
- Displays inode content.
- Stat [file or directory]