[cut] Extract the first characters of a line

Created on November 30, 2026

Use cut -c to select positions in each input line. The range 1-5 selects the first five positions in this ASCII example.

printf '%s\n' 'abcdefghij' | cut -c 1-5
abcde
Shell command