Linux viewing file and folder sizes

Source: Internet
Author: User


Linux viewing file and folder sizes

1. Du-sh View current folder size

Du-sh * | Sort-n Statistics the current folder (directory) size and sort by file size

Comes:
Du-sk filename View specified file size


2, Linux:ls to see the file size in K, M, G units

#ls-LHS

Example comparison:

# ls
Cuss.war Nohup.out

# ls-l
Total 30372
-rw-r--r--1 root root 31051909 may 10:07 Cuss.war
-RW-------1 root root 0 Mar 13:52 nohup.out

# LS-LH
Total 30M
-rw-r--r--1 root root 30M may 10:07 Cuss.war
-RW-------1 root root 0 Mar 13:52 nohup.out

# ll-h
Total 30M
-rw-r--r--1 root root 30M may 10:07 Cuss.war
-RW-------1 root root 0 Mar 13:52 nohup.out

# LS-LHS
Total 28G
15g-rw-r--r--1 root root 15G 06-04 14:35 all.txt
8.0k-rwx--x--x 1 root root 632 06-04 15:57 hash.pl


Linux viewing file and folder sizes

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.