flip - reverse order of bits in a file
flip [-b block_size_bytes] [-w word_size_bits] [input_file [output_file]]
flip reverses order of bits in a file. The input_file optional parameter specifies input file, by default stdin. The output_file optional parameter specifies output_file, by default stdout.
The options are as follows:
- -b block_size_bytes
Divide the file into blocks of block_size_bytes and reverse order of bits within each block. By default the whole file is treated as one block. This option is mandatory if input is stdin.
- -w word_size_bits
Treat word_size_bits number of consecutive bits as one unit (word). The program does not change the order of bits within the unit.
By default one bit is treated as one unit.
flip -b 4 -w 8
- converts input of 4-byte words from little-endian byte order to big-endian, and visa-versa.
flip -b 8 -w 8
- converts input of 8-byte words from little-endian byte order to big-endian, and visa-versa.
- completely reverses order of bits in the input_file. For example it will convert the string of bits 01110010 into 01001110.
- is equivalent to
flip -w 1 input_file
The following command converts the string of bits 01110010 into 10001101:
flip -w 2 input_file
The flip executables for Linux,AIX 6.1,Windows 7 are available for download:
The functionality of flip should be merged into GNU dd
Sergei Viznyuk <email@example.com>
©1998 PhysTech, Inc. All rights reserved. Last change: Feb.8, 2015