21.6. Low-Level File Butchery with dd
Go to http://examples.oreilly.com/upt3 for more information on: dd
dd provides an unexpectedly easy answer. Let's say you wanted to delete the first 100 characters in a file. Here's the command that will do the trick (assuming of course that you give dd a filename with the if= option or data from a pipe):
% dd bs=100 skip=1
Or you could try:
% dd bs=1 skip=100
dd normally reads and writes data in 512-byte blocks; the input block size can be changed with the ibs= option, and the output block size with obs=. Use bs= to set both. skip= sets the number of blocks to skip at the start of the file.
Copyright © 2003 O'Reilly & Associates. All rights reserved.