How to see how many files are in the Linux folder (Mac same)

Source: Internet
Author: User

See how many files and folders are in the directory, in the terminal input

lswc-w

See how many files are in the directory, enter in the terminal

ls | wc -c

Look at the number of files under the folder, how many subdirectories, in the terminal input

ls-l |wc-l

If you only want to know the number of files, in the terminal input

/bin/ls-l |grep ^-|wc-l

查看每个磁盘的大小,每个目录的所占大小。

df -hl 比如mac盘,U盘大小

cd /

du -sh * 当前目录下,每个目录所占的大小

df -h 查看整个硬盘大小,-h 表示人可读的

du -d 1 -h 命令进看当前目录下所有文件夹大小,-d 指深度,后面加一个数组

How to see how many files are in the Linux folder (Mac same)

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.