When dealing with processing really large files (300files~15MBeach), it quickly becomes a process that you have to wait a long time for it to finish. I wrote a Java program that manipulated a flat text P1/90 (Seismic Vessel’s Positions) file and outputed a corrected version in another directory. Thus I wanted to check how far along it had gone and when I should expect it to finish.
Mind you I could have done this in the Java code – keep a record of all the files and how many had been processed – but this project was time-constrained so I didn’t have the luxury of developing it the way I wanted; it had to be done quickly. I therefore delegated the monitoring to the command line tools. Since I new how many files I had originally and how many were being created in the new directory, all I had to do is count each of them and compare them. The following one-liner does exactly that:
watch 'ls *190 | echo -n "`wc -l`"; echo -n "/"; ls ../*90 | wc -l'