Aug 30

dd is a great tool for low-level copying and conversion of raw data. It can be also used for data erasure. Unfortunately, it doesn’t show any information about progress of copying.
Here is my little, but useful script:

1
2
3
4
5
6
7
8
9
10
#!/bin/bash 
# dd.sh Author: Wojtek Jamrozy (www.wojtekrj.net)
 
dd $* & pid=$!
sleep 10
 
while [ -e "/proc/$pid" ] ; do
	kill -USR1 $pid 
	sleep 10
done

Read More


Aug 13

There are two files (for example called „f1” and „f2”). We want to swap contents of these files. Here is an easy bash script, which solves this problem:

#!/bin/sh
# Created by Wojtek Jamrozy (www.wojtekrj.net)
mv $1 cop_$1
mv $2 $1
mv cop_$1 $2

  swap (93 bytes, 175 hits)

Read More


Jul 30

I have directory with data (music, photos, ebooks etc.) on my two computers. I wanted to have exactly same files in my data directory on both machines, but sometimes I changed content of the directory on one of computers. I’ve decided to write program, which would help me to update data directory on another machine. Read More