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 03-23-2006, 09:19 AM   #1
pajout
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
titopoquito
Senior Member
 
Registered: Jul 2004
Location: Lower Rhine region, Germany
Distribution: Slackware 14.1 (32 and 64 bit)
Posts: 1,594

Rep: Reputation: 124Reputation: 124
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
muha
Member
 
Registered: Nov 2005
Distribution: xubuntu, grml
Posts: 451

Rep: Reputation: 37
maybe diff and patch? http://wiki.linuxquestions.org/wiki/Diff
 
Old 03-23-2006, 10:41 AM   #4
zeitounator
Member
 
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
pajout
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 ;>)
 
  


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
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


All times are GMT -5. The time now is 08:21 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration