CentOS statistics file and image file

Source: Internet
Author: User
Today, I encountered a problem in CentOS. It took tens of minutes to open a folder containing tens of thousands of images. However, each time I operate only a few images, this will waste a lot of time. the best way is to operate through the command line. First, check the number of images. First, use ls-l to display the details of all files in the file. the file permission contains the & rdquo;-& ldquo; character, search for all bands & rdquo;-& l using grep

Today, I encountered a problem in CentOS. It took tens of minutes to open a folder containing tens of thousands of images. However, each time I operate only a few images, this will waste a lot of time. the best way is to operate through the command line.

First, check the number of images. First, use ls-l to display the details of all files in the file. the file permission contains the "-" character, search for all files with "-" by using grep and count by wc-l,

ls -l | grep "^-" | wc -l

Similarly, the folder permission contains the "d" character, so you can use the following command to count the number of folders,

ls -l | grep "^d" | wc -l

You can run the following command to check whether an image file is in a folder. If an image file exists, the image name is displayed. Otherwise, an error message is displayed,

find 1.png

To view basic information about an image, such as the format and resolution, run the following command,

file 1.png

Finally, browse the image through the image browser (Eye of GNOME) under CentOS, and enter the following command to view the image through the command line,

eog 1.png

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.