Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 03-23-2006, 09:19 AM   #1
LQ Newbie
Registered: Aug 2005
Posts: 2

Rep: Reputation: 0
I want to change one byte in a large file,

and I cannot find the proper command line utility. The file has ~ 1GB, I know the offset and new value of the byte. I use bash...
Old 03-23-2006, 10:27 AM   #2
Senior Member
Registered: Jul 2004
Location: Lower Rhine region, Germany
Distribution: Slackware64 14.2 and current, SlackwareARM current
Posts: 1,602

Rep: Reputation: 126Reputation: 126
You can use "head -c" and "tail -c" to output the first and last c bytes in a file with a redirection. I don't know how to output a special byte though.
Old 03-23-2006, 10:40 AM   #3
Registered: Nov 2005
Distribution: xubuntu, grml
Posts: 451

Rep: Reputation: 37
maybe diff and patch?
Old 03-23-2006, 10:41 AM   #4
Registered: Aug 2003
Location: Montpellier, France, Europe, World, Solar System
Distribution: Debian Sarge, Fedora core 5 (i386 and x86_64)
Posts: 262

Rep: Reputation: 30
would hexedit suit your needs ?
Old 03-23-2006, 10:53 AM   #5
LQ Newbie
Registered: Aug 2005
Posts: 2

Original Poster
Rep: Reputation: 0
Thanks for replies,
- diff and patch are line-oriented, this is binary (FC5 install images)
- head and tail is a good idea
- I tried hexedit, but Gnome eat my F2 keypresses ;(
- so I used cmp -l and manually edited with ghex, brutally swapping

Result: I'v repaired my downloaded images to satisfy sha1 checksum ;>)


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
File Byte Level replication. Jamesman Linux - Software 3 01-26-2006 02:40 PM
Cheap 4 Terra byte File Server diskless, iSCSI , LVM kyriakos Linux - General 2 12-09-2005 10:31 AM
Proftp Server 60min timeout on large file transfers how cna i change this? methodh2k Linux - General 3 10-19-2005 08:39 AM
Can you create an empty file and specify the byte length? harryo Linux - General 3 02-25-2004 10:01 PM
0 byte file size and lost chains with 200GB firewire drive eviscerate Linux - Software 1 11-24-2003 02:08 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:25 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration