Common and convenient commands and tips for Centos

Source: Internet
Author: User
1. in many cases, you need to know the large files in the current system, such as the file size exceeding MB or 1 GB (the threshold value depends on the actual situation ). How can we search these large files? # For example, if you want to search for files larger than MB in the current directory, find. -typef-size + 900M-print0 | xargs-0du-h2, sometimes disk space alarm, and you usually neglect management, monitoring

1. in many cases, you need to know the large files in the current system, such as the file size exceeding MB or 1 GB (the threshold value depends on the actual situation ). How can we search these large files?

# For example, I want to search for files larger than MB in the current directory.

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

 

2. sometimes the disk space alarm is triggered, and you usually neglect the management and monitoring file growth, so I need to quickly know which directories are getting bigger, now we can use the du command to solve this problem.

# For example, I want to query which Directory under the root directory is relatively large (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 memory status, you can use free and vmstat. pay attention to the value of cached, which is the memory occupied by the kernel and the value of free.

 

5. use dmesg to view some hardware or driver information or problems.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.