35.6 Low-Level File Butchery with ddWant to strip off some arbitrary number of characters from the front of a file? 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): % Or you could try: % 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. Why would you want to do this? Article 22.17 gives an interesting example when encrypting files. Article 20.6 explains using dd over a network with a tape drive. To convert files between ASCII and EBCDIC, see article 35.12 . Article 35.13 shows even more uses for dd . - |
|