Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question
up vote 4 down vote accepted

The cut command might fit your needs:

echo "1234567890" | cut -c 6-


share|improve this answer
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! – David Oneill Apr 20 '12 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 '12 at 17:29
Oh! I hadn't noticed the brackets until you pointed them out. Thanks!!! – David Oneill Apr 20 '12 at 17:36

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.