View file and folder sizes under Linux

Source: Internet
Author: User
When the size of the disk exceeds the standard, there will be alarm prompts, if you know the DF and du command is a very wise choice.

DF can view the first-level folder size, usage scale, file system and its hang-in points, but there is nothing to file.

Du can view the size of files and folders.

It works well with both. For example, use DF to see which level of directory is too large, and then use DF to see the size of the folder or file, so you can quickly determine the crux of the problem.

The following is a brief introduction

File systems that can be used to view partitions
Df-t

The DF command can show the available space and usage for all current file systems, as shown in the following example:
Df-h

Viewing the use of files in your system
Df-h
View the size of each file and directory in the current directory
Du-sh *

Method One: Switch to the directory you want to delete, delete all files in the directory
Rm-f *

Method Two: Delete all files under the Logs folder without deleting the folder itself
RM-RF log/*

View file and folder sizes under Linux

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.