One Linux command per day: Du

Source: Internet
Author: User
Tags disk usage

1. Introduction to Commands

du (disk usage) calculates the disk usage for each file, and the directory takes the total amount.

2. Usage
Usage:du  [options] ... [File] ... Or:du [options] ...--files0-from=f
3. Options

4. Example 1: Show the size of a single file (k by default)
Du4    sendim.py
Example 2: Displaying file sizes in a humane way
du -4. 0K    sendim.py
Example 3:-k display file size in units
du -4    sendim.py
Example 4:-s option sum sum

du -sh ./1.6M    ./

Example 5: Output the space used by each subdirectory under the current directory

[Email protected] ~]#du--max-depth=14./Templates -./. GCONFD -./. Gnome24./Image284./. gconf4./Document4./of public4./Dir14./Music4./. ABRT4./Video384./.gstreamer-0.10 -./. Gnote184./. Cache -./. GnuPG4./Download148./. Pulse +./. config A./. Dbus -./study148./. Local4./. Gvfs4./. Nautilus8./.SSH A./Desktop1620.

One Linux command per day: Du

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.