Showing entries with tag "CLI".

Found 2 entries

Linux: repeatedly run a command to monitor output

If you need to repeatedly run a command and view the output changes over time then check out my cli_watch.pl script. I was watching a RAID array rebuild slowly and needed a way to see the progress over time.

Usage: cli_watch.pl [--delay 15] [--line 3] command

Run my_command every 15 seconds:

cli_watch.pl --delay 15 'my_command | grep stuff'

Filter output to only line 2:

cli_watch.pl --line 2 'ping -c 1 192.168.5.222'

Leave A Reply - 1 Reply

Linux date manipulation

The date command in Linux is very powerful for converting dates and times. If you have a given time in another timezone, or even UTC, you can convert it to your local timezone with this command:

date -d '2008-05-13 14:00 UTC'

If you want to convert a given time into unixtime just use a date format:

date +%s -d '2008-05-13 14:00 UTC'
Leave A Reply