Print characters 1 through 8 from each line.

Section: cut and paste

Extract character positions

bash
bash
cut -c1-8 ids.txt
Explanation

Character mode is handy for fixed-width text formats.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing cut and paste
Extract comma-delimited fields
Print the first and third fields from a CSV-like file.
OpenIn sheetbashsame section
Exclude selected fields
Print all fields except one.
OpenIn sheetbashsame section
Merge files side by side
Combine lines from two files into columns.
OpenIn sheetbashsame section
Paste with a custom delimiter
Combine files using commas or tabs.
OpenIn sheetbashsame section
Delete characters
Remove all digits from a stream.
OpenIn sheetbash1 tag match
Sort lines alphabetically
Default lexicographic sort.