I am a newbie to linux and I am trying to watch a command and try to log it into a file. I tried watch -t -n 10 "(date '+TIME:%H:%M:%S' ; ps aux | grep "pattern" | wc -l)" >> logfile and am expecting a result like TIME: 10:32:30 12 TIME: 10:32:40 18 TIME: 10:32:50 2 to be stored in logfile. However, when the logfile has unprintable characters in in. How do I get this kind of output from the comman
![Store the output of date and watch command to a file](https://cdn-ak-scissors.b.st-hatena.com/image/square/1903ece89af850aed3e9777e774c51491b959a61/height=288;version=1;width=512/https%3A%2F%2Fcdn.sstatic.net%2FSites%2Fsuperuser%2FImg%2Fapple-touch-icon%402.png%3Fv%3De869e4459439)