-c, --bytes
Print the first NUM bytes of each file; with a leading '-', print all but the last NUM bytes of each file.
An option of headx.
Usage
headx -c [-]NUM [FILE]...
headx --bytes=[-]NUM [FILE]...Details
| Short | Long | Value | Default | Meaning |
|---|---|---|---|---|
-c | --bytes | [-]NUM | print the first NUM bytes of each file; with a leading '-', print all but the last NUM bytes of each file |
Examples
Print the first kibibyte of a file
headx -c 1K image.png > start.binCheck a file's magic number from its first bytes
headx -c 4 image.png | catx -vCopy the first megabyte (10^6 bytes) of a large file
headx -c 1MB disk.img > sample.imgStrip the final byte, such as a trailing newline
headx -c -1 version.txtHelp in the terminal
gnux help headx --bytes