If I have really long output from a command (single line) but I know I only want the first [x] (let's say 8) characters of the output, what's the easiest way to get that? There aren't any delimiters.
Command Line – Grabbing First [x] Characters from a String
command lineshelltext processing
Best Answer
One way is to use
cut
:This will give you the first 8 characters of each line of output. Since
cut
is part of POSIX, it is likely to be on most Unices.