Watch a dig in progress

watch -n1 dig google.com
Watch a dig in progress
Sample Output
watch -n1 dig google.com

1
By: ene2002
2013-12-26 19:23:27

These Might Interest You

  • You're running a program that reads LOTS of files and takes a long time. But it doesn't tell you about its progress. First, run a command in the background, e.g. find /usr/share/doc -type f -exec cat {} + > output_file.txt Then run the watch command. "watch -d" highlights the changes as they happen In bash: $! is the process id (pid) of the last command run in the background. You can change this to $(pidof my_command) to watch something in particular. Show Sample Output


    1
    watch -d "ls -l /proc/$!/fd"
    flatcap · 2014-01-31 23:51:17 0
  • Recent versions of dd provides status flag. Setting that flag to progress shows progress in realtime.


    0
    dd status=progress if=infile of=outfile bs=512
    tankmohit11 · 2017-03-15 05:46:25 0
  • Running this code will execute dd in the background, and you'll grab the process ID with '$!' and assign it to the 'pid' variable. Now, you can watch the progress with the following: while true; do kill -USR1 $pid && sleep 1 && clear; done The important thing to grasp here isn't the filename or location of your input or output, or even the block size for that matter, but the fact that you can keep an eye on 'dd' as it's running to see where you are at during its execution.


    8
    dd if=/dev/urandom of=file.img bs=4KB& pid=$!
    atoponce · 2009-04-08 05:56:47 6
  • pv allows a user to see the progress of data through a pipeline, by giving information such as time elapsed, percentage completed (with progress bar), current throughput rate, total data transferred, and ETA. (man pv) Show Sample Output


    55
    pv sourcefile > destfile
    edo · 2010-03-20 20:55:18 2

What Others Think

Nice. Simply but effective.
DaveQB · 233 weeks and 2 days ago
Simple even too.
DaveQB · 233 weeks and 2 days ago
Yes_THX
ene2002 · 228 weeks and 6 days ago

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands



Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: