Home  >  Article  >  System Tutorial  >  Introduction to a collection of commonly used and convenient commands and techniques in Centos

Introduction to a collection of commonly used and convenient commands and techniques in Centos

WBOY
WBOYforward
2024-01-07 16:50:23826browse

1. Many times, you need to know what large files there are in the current system, for example, the file size exceeds 100M or 1G (the threshold depends on the specific situation). So how to search these large files?

#For example: I want to search for files exceeding 900M in the current directory

find . -type f -size 900M -print0 | xargs -0 du -h

2. Sometimes there is a disk space alarm, and you usually neglect to manage and monitor the growth of files. Then I need to quickly understand which directories have become larger. At this time, we can use the du command to help us solve the problem. this problem.

#For example: I want to query which directory under the root directory has become larger (of course I think it must be /var)

cd /

du -h --max-depth=1

3. Return to the home directory

cd ~

4. If you want to know the status of the memory, you can use free and vmstat. You need to pay attention to the cached value, which is the memory occupied by the kernel, and the free value.

5. Use dmesg to check some hardware or driver information or problems.

The above is the detailed content of Introduction to a collection of commonly used and convenient commands and techniques in Centos. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:jb51.net. If there is any infringement, please contact admin@php.cn delete