LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   dd question (https://www.linuxquestions.org/questions/linux-newbie-8/dd-question-589678/)

mokku 10-05-2007 10:39 AM

dd question
 
Hi,

I have read about DD command, what it means by "dd if=/dev/zero " , any explanation would be appriciated.

Thanks

cmnorton 10-05-2007 10:40 AM

/dev/zero and /dev/null
 
if means input file
/dev/zero and /dev/null are the same, the bit bucket or null device. If the input file is /dev/zero, it sounds like this command is for zeroing a file or device.

zhangmaike 10-05-2007 12:27 PM

/dev/null and /dev/zero are not the same.

While both can act as bit buckets, reading from
/dev/null is equivalent to reading an empty file, while reading from /dev/zero results in an infinite stream of null bytes (bytes with value 0).

rsashok 10-05-2007 01:09 PM

Example:
1. dd if=/dev/null of=x count=1 bs=1024

Doesn't work. Created file 'x' has zero size

2. dd if=/dev/zero of=x count=1 bs=1024
Creates file 'x' of size 1024 filled with binary zeros.

Check out this link:
http://www.linuxquestions.org/questi...ommand-362506/

mokku 10-06-2007 07:10 AM

Hello Guys,

Thank you so much. Does it mean, it crates the file from /dev/zoero and copy it into file x ?

Thanks in advance.

mokku 10-06-2007 10:11 AM

When it creates file called X, what parttion it is using?

rsashok 10-07-2007 12:11 PM

Quote:

Does it mean, it crates the file from /dev/zoero and copy it into file x
Not in a sense of copying /dev/zero to you output file. It uses /dev/zero as a pattern to write the output file. If you need any other data then zero you might use "if=/dev/random" for input file.

Quote:

When it creates file called X, what parttion it is using?
It is created in the partition where the output file directory located. For example if output file is "of=/home/user/mokku/new_file", then it is in the partition of /home/user/mokku.

mokku 10-08-2007 06:52 AM

Thank you so much, I got it now.


All times are GMT -5. The time now is 06:45 PM.