LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Learn the DD command (https://www.linuxquestions.org/questions/linux-newbie-8/learn-the-dd-command-362506/)

catbird 02-05-2010 10:29 AM

I'd like to have this in hardcopy
 
This has been very helpful. I'd like to download and print it. Consider a handbook or book. I'd buy it!

onebuck 02-05-2010 02:35 PM

Hi,

Quote:

Originally Posted by catbird (Post 3853946)
This has been very helpful. I'd like to download and print it. Consider a handbook or book. I'd buy it!

You can use the 'Thread Tools' to show a printable version then print it.

:hattip:

AwesomeMachine 02-09-2010 09:22 AM

A Book?
 
Quote:

Originally Posted by catbird (Post 3853946)
This has been very helpful. I'd like to download and print it. Consider a handbook or book. I'd buy it!

I have written several books. None of them are about Linux. The first one will be released November 2010.

Thank you for the encouragement. I'll write a dd book sometime during the next two years.

-Awesome

JZL240I-U 02-11-2010 03:44 AM

Please keep us informed. I am interested as well. Good job and thanks, AwesomeMachine

Penguin01 03-06-2010 09:15 AM

This is a brilliant thread, but I am stuck on a particular issue.

I am trying to dd a certain number of bytes from my USB. So, for example, byte 1000 to 5000 of my 512MB USB stick.

From what I have looked at, the command looks as follows:
dd if=/dev/sdb of=/home/user/file.txt seek=1000 count=5000

But is this correct?



Thanks!

Tinkster 03-06-2010 04:07 PM

In what way are you "stuck"?

drmjh 03-07-2010 08:32 AM

Dear Tinkster,

Quote:

Btw, I'll rather attempt to aid you in helping yourself than
giving you a "turn-key solution". I believe in enabling people
to help themselves, rather than carrying them everywhere. ;}
This is a noble, and for the most part, an intelligent approach.
However, giving the exact code sequence is often more helpful in many circumstances. The snippet of code that works is an example of proven success and in itself easily becomes a 'tool' that one can embellish, diminish etc.
Personally, I learn more from annotated 'good code' than by reading and trying to figure out arcane 'descriptions' found in MAN pages etc.
It could be that both approaches are quite valid.
Matthew

Tinkster 03-07-2010 10:31 AM

Quote:

Originally Posted by drmjh (Post 3889171)
Dear Tinkster,



This is a noble, and for the most part, an intelligent approach.
However, giving the exact code sequence is often more helpful in many circumstances. The snippet of code that works is an example of proven success and in itself easily becomes a 'tool' that one can embellish, diminish etc.
Personally, I learn more from annotated 'good code' than by reading and trying to figure out arcane 'descriptions' found in MAN pages etc.
It could be that both approaches are quite valid.
Matthew


Now why exactly do you think it's a good idea to comment
on my signature in a thread on dd?



Cheers,
Tink

jstephens84 03-07-2010 10:57 AM

Quote:

Originally Posted by Penguin01 (Post 3888234)
This is a brilliant thread, but I am stuck on a particular issue.

I am trying to dd a certain number of bytes from my USB. So, for example, byte 1000 to 5000 of my 512MB USB stick.

From what I have looked at, the command looks as follows:
dd if=/dev/sdb of=/home/user/file.txt seek=1000 count=5000

But is this correct?



Thanks!

Looking through the man pages that looks correct. However I am not sure I am reading the count right. IE I am thinking that it is saying it will copy 5000 bytes from the initial stating byte or 1000. So in short (if I am reading this correctly) it would copy 1000 to 6000. I would try changing count = 4000 and see if it gets what you are looking for. You can always backup the results and try different values.

Best way to learn is through mess ups and experimentation.

Penguin01 03-13-2010 05:57 AM

That seems to work, thank you jstephens84.

But even if I save it into a text file (called file.txt, for example), I still cannot open it.
Is there a reason why, I cannot see the contents of the dd output?

pixellany 03-13-2010 06:33 AM

If you use dd to put a partition image into a file---the file will not be a text file (even if you add the "txt" extension).

You can read **any** file with something like hexdump.

jstephens84 03-13-2010 08:38 AM

Quote:

Originally Posted by Penguin01 (Post 3896646)
That seems to work, thank you jstephens84.

But even if I save it into a text file (called file.txt, for example), I still cannot open it.
Is there a reason why, I cannot see the contents of the dd output?

Normally if I am going to output parts of a hard disk I am just going to dump those parts to say an external hard drive or another partition. The reason you just can open those text files is because you Possibly tried to insert binary data into a text document.

AwesomeMachine 03-27-2010 11:03 PM

Skip, Count
 
Quote:

Originally Posted by Penguin01 (Post 3888234)
This is a brilliant thread, but I am stuck on a particular issue.

I am trying to dd a certain number of bytes from my USB. So, for example, byte 1000 to 5000 of my 512MB USB stick.

From what I have looked at, the command looks as follows:
dd if=/dev/sdb of=/home/user/file.txt seek=1000 count=5000

But is this correct?



Thanks!

If you want to read the USB drive, and write the bytes 1000 to 5000:

dd if=/dev/sdc1 skip=1000 count=4000

AwesomeMachine 03-27-2010 11:09 PM

Leave off 'of='
 
Quote:

Originally Posted by Penguin01 (Post 3896646)
That seems to work, thank you jstephens84.

But even if I save it into a text file (called file.txt, for example), I still cannot open it.
Is there a reason why, I cannot see the contents of the dd output?

If you leave out of= dd will print to the screen. If you want to read the output:

dd if=/dev/sdc1 | hexdump -C | less

Less would be my favorite editor, except you can't edit with it.

aus9 03-28-2010 06:03 PM

hi

I prefer strings so if above awesome command is awesome ignore mine

Code:

su
dd if=/dev/sdc1 | strings | less



All times are GMT -5. The time now is 08:41 PM.