df -h and df -i in linux command df

df command:

The function of the df command in Linux is to check the disk space occupation of the file system of the Linux server. You can use this command to get information about how much space the hard disk is occupying and how much space is left.

1. Command format:

df [options] [file]

2. Command function:

Displays the free space of the specified disk file. If no file name is specified, the free space of all currently mounted file systems will be displayed. By default, disk space will be displayed in units of 1KB, unless the environment variable POSIXLY_CORRECT is specified, then it will be displayed in units of 512 bytes.

3. Command parameters:

Required parameters:

-a List of all file systems

-h display for easy reading

-H is equal to "-h", but the calculation formula, 1K = 1000, not 1K = 1024

-i display inode information

-k block is 1024 bytes

-l only show local file system

-m block is 1048576 bytes

--no-sync ignore sync command

-P output format is POSIX

--sync execute the sync command before getting the disk information

-T file system type

Choose parameters:

--block-size = <block size> specify block size

-t <file system type> Only display the disk information of the selected file system

-x <file system type> do not display the disk information of the selected file system

--help display help information

--version display version information

The "df -h" command is familiar. Display the current disk space and usage in a more readable way.

"Df -i" displays disk usage in inode mode.

What is the difference between df -h and df -i? It is also showing the disk usage, why is the display occupancy percentage very different?

The better explanation of df -h is to check the usage of disk capacity.

As for df -i, first need to understand the inode
to the blogger ’s personal understanding. In the simplest terms, the information contained in the inode: the number of bytes in the file, owner id, group id, permissions, change time, number of links, data block location. On the contrary, it does not indicate the file size. This is why the results displayed by df -h and df -i are not the same.

ps : The df -h and df -i display usage rate is 100%, the basic solution is to delete the file.

df -h is to delete relatively large and useless files ----------- large files take up a lot of disk capacity.

df -i deletes too many small files ----------- too many files occupy a lot of inode numbers.

Guess you like

Origin www.cnblogs.com/fanblogs/p/12713015.html