a useful list techniques to use in Linux

Lennart Sorensen lsorense-1wCw9BSqJbv44Nm34jS7GywD8/FfD2ys at public.gmane.org
Tue Jan 31 15:42:42 UTC 2012


On Tue, Jan 31, 2012 at 10:07:25AM -0500, Jamon Camisso wrote:
> Biggest thing for me was learning non-greedy regular expressions using
> negated characters for use with egrep and sed. I don't use grep at all
> now, and rarely use a .* or .+.
> 
> Next up, here documents were a revelation for me. Sometimes the need
> arises, and being able to ssh foo <<EOF and then run a few commands in a
> bash script say is remarkably handy sometimes.
> 
> Last, I was quite pleased to learn that dd responds to SIGUSR1 and will
> display its status if you ask it nicely. Start a dd in a new terminal or
> screen session:
> 
> [9:51:31|12-01-31]jamon at jamon:pts/5: /home/jamon
>  0 % dd if=/dev/zero of=/dev/null
> 
> Then send it SIGUSR1:
> pkill -SIGUSR1 dd
> 
> You'll see something like this:
> 7029904+0 records in
> 7029904+0 records out
> 3599310848 bytes (3.6 GB) copied, 2.23009 s, 1.6 GB/s
> 
> Quite handy for large dd operations. Combine with watch (or watch -d on
> the target dd output file if applicable?) and you've got a decent way to
> monitor progress.

I tend to do:

dd if=/... of=/... bs=... etc &
while killall -USR1 dd; do sleep 5; done

It conviniently stops when dd is done (or at least within 5 seconds of
it being done.

-- 
Len Sorensen
--
The Toronto Linux Users Group.      Meetings: http://gtalug.org/
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://gtalug.org/wiki/Mailing_lists





More information about the Legacy mailing list