Linux file system commonly used commands explained in detail

>>> Linux tutorial directory <<<

File system management-2.1df, du, fsck, dumpe2fs commands

Write in the front: If you finish the inspection by yourself, there may be some mistakes. If you find something wrong, you can leave a message or private message me below.

1. File system view command df

  • df [options] [mount point]
    • -a: display all file system information, including special file systems, such as / proc, / sysfs
    • -h: display the capacity using customary units, such as KB, MB or GB, etc.
    • -T: display file system type
    • -m: display capacity in MB
    • -k: display capacity in KB (default is in KB)

2. Statistics directory or file size du

  • du [options] [directory or file name]
    • -a: display the disk occupancy of each subfile. By default, only the disk occupancy of subdirectories is counted
    • -h: display the capacity using customary units, such as KB, MB or GB, etc.
    • -s: Count the total occupancy without listing the occupancy of subdirectories and subfiles

3. The difference between du command and df command

  • The df command is considered from the file system, not only to consider the space occupied by the file, but also to count the space occupied by the command or the program (the most commonly used is that the file has been deleted, but the program has not released space)
  • When the du command is file-oriented, only the space occupied by the file or directory is calculated

4. File system repair command fsck

  • fsck [options] [partition device file name]
    • -a: Automatically repair the file system without displaying user prompts
    • -y: automatic repair, the same effect as -a, but some file systems only support -y

5. Show disk status command dumpe2fs

  • dumpe2fs [partition device file name]
  • You can see how big a data block is in the partition

Write in the back: I hope these explanations will be helpful to you, I hope everyone will like and pay attention to it. Your support is my biggest motivation (๑> ؂ <๑)

Published 366 original articles · praised 68 · 50,000+ views

Guess you like

Origin blog.csdn.net/qq_43479432/article/details/105655565
Recommended