Finding disk space in a Linux system

Source: Internet
Author: User

directory to see the space usage

DU-SH/* First look under the root directory

Let the file under the folder let the file sort by size

  • Method One: # ls -lhSl long format display, H Human readable mode, size unit is M,G and other easy-to-read format, S size sort by size.
  • Method Two: #du -h * | sort -n
    • Du: Calculates the disk space consumption of a single file or folder.
    • Sort: Sorts the output of a file row or standard output row record.
    • Head: The previous part of the output file content.

# Du-a/var | Sort-n-R | Head-n 10

You can also combine pipelines to view the largest number of files within a folder or the smallest number of files, plus pipe symbols and head or tail commands du -h * | sort -n|headdu -h * | sort -n|tail

Finding disk space in a Linux system

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.