Wednesday 17 May 2017

Linux Shell Commands

 LINUX DD COMMAND

The dd command stands for “data duplicator” and used for copying and converting data.

dd if=<source file name> of=<target file name> [Options]
if=<source> –This is a source from where you want to copy data and ‘if’ stands for input-file.
of=<destination> –This is a source from where you want to write/paste data and ‘of’ stands for output-file.
[options] –These options include, how fast data should be written, what format etc.
1: Clone one hard disk to another hard disk.
 dd if=/dev/sda of=/dev/sdb
 2: Wipe/delete content of a disk so that it will be empty for some one to use it. 
dd if=/dev/zero of=/dev/sdb

 3. We can even create ISO files from a CD-ROM or DVD-ROM using dd command.

dd if=/dev/dvd of=/opt/my_linux_image.iso

 4. create a file of any given size

$ dd if=/dev/zero of=testss bs=1024 count=1048576This will create a file of size 1024 * 1048576 bytes (or 1 GB)

 where
if - input file
of - output file or the file to be created
bs - block size in bytes
count - # of blocks of size bs

 

 

No comments:

Post a Comment