Linux Common commands

Source: Internet
Author: User
Viewing the usage of files in the system df-h//view the size of each file and directory under the current directory Du-sh *//method One: Switch to the directory you want to delete, delete all files under directory Rm-f *//method Two: Delete all files under the Logs folder without deleting the folder itself RM -RF log/*

Du: Querying disk usage space for a file or folder

If you have a lot of files and folders under the current directory, you can cycle through the space used by all files and folders using the command without the parameter Du. This is not good to see if it is too large, so you have to specify the number of layers in the depth directory, parameter:--max-depth=, this is a very useful parameter!

As follows, note that using "*", you can get the space size of the file.

Du-h--max-depth=1/home

Linux Common commands

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.