1

what's a commandline tool to take input from stdin, remove the first X character, and place the output to stdout?

Similar to how tail can skip the X lines and display the rest, but for characters on each line instead of lines in each file.

1 Answer 1

4

The cut command might fit your needs:

echo "1234567890" | cut -c 6-

Outputs:

67890
3
  • Oh, that does work - I read through the man page, and it didn't say you could leave off FILE, so I assumed this wouldn't work. Thanks! Apr 20, 2012 at 17:26
  • You're welcome! Square brackets generally mean optional arguments, if you do not specify a file it reads standard input. :)
    – lgarzo
    Apr 20, 2012 at 17:29
  • Oh! I hadn't noticed the brackets until you pointed them out. Thanks!!! Apr 20, 2012 at 17:36

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .