LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-05-2007, 11:39 AM   #1
mokku
Member
 
Registered: Feb 2007
Posts: 197

Rep: Reputation: 30
dd question


Hi,

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

Thanks
 
Old 10-05-2007, 11:40 AM   #2
cmnorton
Member
 
Registered: Feb 2005
Distribution: Ubuntu, CentOS
Posts: 585

Rep: Reputation: 35
/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.
 
Old 10-05-2007, 01:27 PM   #3
zhangmaike
Member
 
Registered: Oct 2004
Distribution: Slackware
Posts: 376

Rep: Reputation: 31
/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).
 
Old 10-05-2007, 02:09 PM   #4
rsashok
Member
 
Registered: Nov 2006
Location: USA, CA
Distribution: RedHat, Debian
Posts: 202

Rep: Reputation: 31
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/
 
Old 10-06-2007, 08:10 AM   #5
mokku
Member
 
Registered: Feb 2007
Posts: 197

Original Poster
Rep: Reputation: 30
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.
 
Old 10-06-2007, 11:11 AM   #6
mokku
Member
 
Registered: Feb 2007
Posts: 197

Original Poster
Rep: Reputation: 30
When it creates file called X, what parttion it is using?
 
Old 10-07-2007, 01:11 PM   #7
rsashok
Member
 
Registered: Nov 2006
Location: USA, CA
Distribution: RedHat, Debian
Posts: 202

Rep: Reputation: 31
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.
 
Old 10-08-2007, 07:52 AM   #8
mokku
Member
 
Registered: Feb 2007
Posts: 197

Original Poster
Rep: Reputation: 30
Thank you so much, I got it now.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Question, Apples Contribution to Open Source + MacOs file structure question Higgy3k Other *NIX 5 07-25-2005 05:23 AM
Not your regular GRUB question - just a short question for a fried MBR!! ziphem Linux - General 3 01-31-2005 02:51 PM
Question 1 Firewall Log Question 2 Network Monitor Soulful93 Linux - Networking 4 08-05-2004 12:05 AM
login prompt question & kde scheme question JustinCoyan Slackware 2 06-09-2004 03:02 PM
RE: Suse 8.0 hardware question {newbie question, pls help} Radiouk Linux - Distributions 2 06-04-2002 01:53 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration