Enumerating file type statistics

- [Instructor] Welcome to the next video of section three,…enumerating file type statistics.…In the previous video, we've learned how to find…symbolic links and their targets.…In this video we'll learn how to write scripts…that can enumerate through many files and collect details.…There are many file types.…It will be an interesting exercise to write a script…that can enumerate through all the files inside a directory,…its descendants,…print a report that provides details of file types,…files with different file types,…and the count of each file type present.…

The file command can be used to find out the type of file…by looking at the contents of the file.…In Unix/Linux systems file types are not determined…based on the extension of the file,…like the Microsoft Windows platform does.…This section aims at collecting file type statistics…of a number of files.…For storing the count of files of the same type,…we can use an associative array…and the file command can be used…to fetch the file type details from each of the files.…

Resume Transcript Auto-Scroll

Author

Released

7/17/2017

Linux shell scripting is a useful tool for programmers and system administrators. It can speed up and automate many tasks, including finding and editing files, editing text, performing advanced searches, downloading data from the web, backing up and archiving data, and transferring files through a network. For Linux administrators, the Linux shell is also a great tool for monitoring system health and deploying updates and software. Learn the basics of Linux shell scripting in this course with Packt trainers Sarath Lakshman and Shantanu Tushar.

Note: This course was created by Packt Publishing. We are pleased to host this training in our library.