Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 11-19-2010, 12:44 AM   #1
Registered: Apr 2006
Location: Australia
Distribution: Debian Squeeze
Posts: 135

Rep: Reputation: 18
writing 0xFF with the dd command

I'm trying to write a 100MB file for example all with 0xFF so in the hex editor it should look like "FF FF FF FF FF FF" etc.

I know you can write a 0x00 with this line:
dd if=/dev/zero of=myfile bs=1M count=100
But how to do 0xFF or another character?

I want to use the 'dd' command because with the 'bs=1M' argument it is 100 times faster than any other shell command I've seen.
Old 11-19-2010, 08:07 PM   #2
Senior Member
Registered: Jan 2005
Location: Manalapan, NJ
Distribution: Fedora x86 and x86_64, Debian PPC and ARM, Android
Posts: 4,593
Blog Entries: 2

Rep: Reputation: 344Reputation: 344Reputation: 344Reputation: 344
dd if=/dev/zero bs=1M count=100 | tr '\000' '\377' > file
1 members found this post helpful.


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
writing your own command in unix/linux amardeep.sidhu Programming 4 03-15-2007 11:52 AM
writing a recursive 'find' command nadroj Programming 5 03-06-2007 01:06 AM
Debian on MacBook Pro: pc_keyb: controller jammed (0xFF) rose_bud4201 Debian 0 02-28-2007 03:36 PM
pc_keyb: controller jammed (0xFF)? maxsu Linux - Hardware 0 02-23-2004 08:44 PM
Command for writing over files? soulflyer Linux - Newbie 2 12-12-2003 05:26 PM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:27 AM.

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