FG
💻 Software

Store the output of date and watch command to a file

Fresh5 days ago
Mar 15, 202686097 views
Confidence Score0%
0%

Problem

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 to be stored in logfile. However, when the logfile has unprintable characters in in. …

Error Output

TIME: 10:32:30    12
TIME: 10:32:40    18
TIME: 10:32:50    2

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
Unverified Fix
New Fix – Awaiting Verification

Fix for: Store the output of date and watch command to a file

Low Risk

This can easily be done using too without using any scripts.

Awaiting Verification

Be the first to verify this fix

Sign in to verify this fix

Environment