Posts Tagged ‘progress bar’

Using kill to display dd progress

Tuesday, November 9th, 2010

How long has that dd process been running for now? Is it even doing anything? How long is it going to take?

If you want dd to give you a progress update, then find out the process ID (PID) and then send the USR1 signal to it with

kill -USR1

And dd will then print out the same records in/out, bytes copied, time taken and overall speed to STDERR as it would when it finishes.

It doesn’t matter if you are re-directing STDOUT (such as to pipe the data stream to another machine via netcat or even compressing it with gzip) but make sure that you aren’t sending STDERR anywhere such as /dev/null

Make sure you specify the “-USR1” argument to kill as you don’t want to send SIGTERM to dd by mistake!
By default, kill will send SIGTERM (or SIGKILL if you use kill -9) to the specified process, but using “-USR1” you are telling kill to send a different signal, in this case one that causes dd to print the progress summary and so you aren’t actually going to “kill” the process.

You can even use have the progress refresh every few seconds with a command such as

watch -n 10 kill -USR1 $PID

Just replace $PID with the PID of the running dd process (or set the PID environment variable to the process ID).
If dd was the last command you ran, then you can get the PID with the special $! variable, otherwise you’ll have to use ps to find the PID.

Re-open an accidentally closed tab in Safari 5.0

Saturday, July 3rd, 2010

Apple’s 5.0 release of the fantastic Safari web browser has introduced a feature I’ve been waiting for since discovering it several years ago in a somewhat unstable third party plugin who’s name escapes me and which has been in Firefox for some time – the ability to re-open an accidentally closed tab.

When combined with the “Reopen Last Closed Window” and “Reopen All Windows from Last Session” items under the history menu, Safari now has all the features that I miss from Firefox for when I accidentally hit the cross or on the rare occasions when it just locks up (usually thanks to bloody Adobe Flash Player!).

To use this awesome new feature, just use the normal undo/redo buttons under the Edit menu.

Safari 5.0 also brings back the nice old school progress meter in the background of the address bar. :)