Linux - NewbieThis 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!
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
Strings will omit quite a large number of sectors.
'strings' has no idea what a sector is or does; it outputs sequences
of printable characters in its input stream. It suppresses characters
w/o a sensible printable representation, and prints candidates for
'hexdump' will faithfully let you output any garbage in a presentable
view, e.g.: a column of hex-data and a column of ASCII data in your
incantation; whether or not that is what one wants to see is a totally
different story. As far as recognisable (human readable) strings goes,
'strings' would be my preferred weapon of choice because I wouldn't need
to worry whether a string has been broken over to the next line.
This is one the most awesome posts I've ever seen! It's like being confronted with the compositions of a manic; overwhelming and disturbing at the same time. I sat there gaping as I just go flushed away. I guess, reading this is just like 'dd'ing your own brain with /dev/random .
Above all, it was entertaining and most educating. Many thanks!!
Learn The DD Command has reached a landmark: 500,000 views. I didn't notice right away. As of this reply there are 505,000 views. When I first conceived of a dd post, all I wanted was a place to gather examples of practical dd usage. There was no central repository at that time, and the existing information was haphazardly strew across cyberspace.
I wanted to put the power of dd in the hands of common computer users, not just computer professionals. I'm a computer professional, and I saw the potential for dd in the hands of beginners. When my classmates in grade school were reading childrens' novels, I was reading how to program a mainframe computer. I never liked kids books, not even as a kid. I knew I'd make a living doing something with computers.
Since I became aware of its existence, I always liked linuxquestions.org. It's a great site. I can't think a better place to have the Learn The DD Command thread than a linuxquestions.org. If you happen to run across this reply, and you're not already a member, take the time to join. When I joined I didn't really need help learning Linux. It's just a great community.
There are more deeply technical Linux forums out there, but the idea of Linux is to have fun. If Linux wasn't fun, I'd find some other OS that was fun, and use that. But anyway, this dd thread has had the benefit of Jeremy's SEO skills. It's not just because it's a great thread that got it to over 500,000 views. Jeremy had a lot to do with it. Google lists threads from this site early in the hit list, because the site has an excellent reputation for useful and quality content; and because the site uses good SEO.
I thank Jeremy for helping this thread become popular. I really have no control other than trying to make the thread useful to people the world over. After that my job is done. And nothing is forever. This thread is not immortal. Nine billion years from now it may very well be space dust. A highly advanced race of multidimensional beings may reassemble linuxquestions.org from random debris drifting through space. They'll say to each other, "The kernel has advanced quite a bit during the last nine billion years."
But what if I then want to flip every bit on the same drive to a 1?
I'm testing solid state drives and I'm interested in their endurance.
Thanks for your help.
Welcome to LinuxQuestions.org. This should work for you:
dd if=/dev/zero bs=32k | sed 's/\x00/\xff/g' | dd of=/dev/target
0x100h = 1 0000 0000b - 1b = 0xffh = 1111 1111b = 255d. So, 0xffh is hex notation for bitwise 1111 1111. In the example above, dd reads 32k of zeroes (0x00h) from /dev/zero. Sed replaces every 32k of hex zeroes with 32k of hex ff.
This would not work without the \x symbols in the sed perl expression, because without them sed would replace ascii 00 (0x3030h) with ascii ff (0x6666h). Sed would not find ascii 00 in the dd bit stream, so dd would pipe through sed unchanged.
Last edited by AwesomeMachine; 06-21-2010 at 11:46 PM.