Keep running and count the number of files in a folder using inotifywait
Over the last few weeks, I've been working on a Python script that generates PDFs. My script had to generate 70,000 of them and that obviously takes a while.
My idea was to have my script run in a Linux console and, in a second console, with a counter that increases with the number of files that have been created on the hard disk.
The first script will be in Python and I wanted something ultra-simple and using a simple Linux command.
The command ls folder_name | wc -l
works but didn't stay running. Let's see how we can do better with inotifywait.