Hidden Linux : Example commands - dd (Part II)
Last time I covered the basic use of dd, Linux's "Convert and copy a file" command. Here are a few more things you can do with it, some trivial, some useful.
File Conversion
Convert a file to uppercase:
dd if=filename of=filename
conv=ucase |
Convert a file to lowercase:
dd if=filename of=filename
conv=lcase |
(Incidentally, if you leave out of= output gets written to "standard output" -- which defaults to the screen.)
File rescue
If a video or sound clip won't play because of bad blocks, copy it, telling dd to ignore the corrupt stuff
dd if=badfile.wav
of=fixedfile.wav conv=noerror |
Wipe all the free space on a partition
(ie: Deleted files you don't want recovered)
dd if=/dev/urandom
of=~/trash.file |
rm trash.file |
Note that dd only overwrites, it doesn't provide a cryptographic deletion. For that you're better off with srm and sfill. (See here.)
Look at your disk
If you have the program hexdump installed (it's available in most standard repositories), you can check out the contents of your hard drive.
Look at the first sector on your hard drive:
dd if=/dev/sda count=1 |
hexdump -C |
![]() |
|



PC World is New Zealand’s top selling computing and technology magazine.
Comments
I made a visit to this blog, I was very pleased with what I saw, are usefully informative and meaningful for the blogger feel good to visit this blog, keep it performing this work will make sure that as much success with these ideas well developed. thanks
Posted by: word | July 29, 2010 2:34 PM