1. df command The [root@localhost ~]# df -ahT Options: Here is an example: [root@localhost ~]# df -hT Filesystem Type Size Used Avail Use% Mounted on /dev/sda3 ext4 19G 2.2G 16G 13% / tmpfs tmpfs 495M 0 495M 0% /dev/shm /dev/sdal ext4 190M 33M 147M 19% /boot Result description: 2. du command The [root@localhost ~]# du [options] [directory or file name] Options: (1) The directory size statistics of We use As shown below: Except for the After I decompressed a As shown in the following figure: The file obtained after decompression is much smaller than the compressed file, which is obviously incorrect data. This is obviously an unreasonable situation. This indicates that there is a problem with the file size statistics of The reason for this problem has to do with partitioning. A directory has its own The data that records the file name and corresponding So execute the If you only need to see the total size of the files, add option [root@localhost ~]# du -hs httpd-2.2.9 explain: Why is the The (2) The difference between The The In addition, if you cannot restart the server at work and want to free up the space occupied by temporary files, you can also release it manually. This method is extremely difficult to operate and the chance of error is high. Manual release is not recommended. The loss caused by a planned restart of a Linux server is much smaller than the loss caused by an unexpected server downtime or restart. 3. fsck file system repair commandThis command is a file system repair command that comes with the Linux system. This command is a bit like the Windows system not shutting down normally (sudden power outage), and the next time you start the computer, you will be prompted whether to scan and repair files. Automatic repair commands: [root@localhost ~]# fsck -y /dev/sdb1 This command will be automatically executed when the Linux system is started. If the file can be repaired through the 4. Display disk status dumpe2fs To display the disk status, use the How to query the partition number? It is very convenient to query it through the Here are the results of executing the command: There is a lot of information above. If you only want to see the super block information (that is, the top part of the information), just add the as follows: [root@localhost ~]# dumpe2fs -h /dev/sda3 5. View the detailed time of the file The results of executing the command are as follows: It's okay as long as you can understand this information. Just understand it. 6. Determine the file type Determine the file type If we judge a file, it will show that the file is an English document in ASCII code. [root@localhost ~]# file anaconda-ks.cfg anaconda-ks.cfg: ASCII English text If we judge a directory, it will show that the file is a directory. [root@localhost ~]# file 123/ 123/: directory Determine the command type The commands in the Linux system are divided into internal commands and external commands If you use the as follows: [root@localhost ~]# type mkdir mkdir is /bin/mkdir If you use the as follows: [root@localhost ~]# type cd cd is a shell builtin If a command has an alias, use the [root@localhost ~]# type ls ls is aliased to 'ls --color=auto' Tip: These two commands are generally used when writing script programs. It is very convenient for us to distinguish between files and folders (using our eyes, haha). This is the end of this article about the commonly used Linux hard disk management commands. For more relevant Linux hard disk management command content, please search 123WORDPRESS.COM’s previous articles or continue to browse the following related articles. I hope everyone will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: Detailed explanation of the implementation example of group ranking in Mysql tutorial
>>: Example of implementing colored progress bar animation using CSS3
MySQL installation is relatively simple, usually ...
Preface In Java programming, most applications ar...
# Installation daemon configuration for Redis on ...
When multiple images are introduced into a page, ...
Today's Tasks 1. Choice of Linux distribution...
1. at is configured to write "This is a at t...
Overlay network analysis Built-in cross-host netw...
This article shares the specific code of React+ts...
Page turning problem scenario B and C are on the ...
I'm currently working on my own small program...
As the application of centos on the server side b...
The browser displays TIF format images Copy code T...
Today, this article introduces some basic concept...
The project was tested these days, and the tester...
Table of contents 1. Description of functions in ...