Wednesday, December 17, 2008

commandline fun tr and seq

Uppercase on the command line:

tr '[:lower:]' '[:upper:]'

Strip all newlines:

tr -d '\n'

Strip all non-printing characters:

tr -dc '[:print:]'

print from 1 to 100:

seq 100

print from 2 to 50, incrementing by 3:

seq 2 3 50

print from 1 to 10, all on the same line:

seq 10 | xargs echo

No comments: