Print text string vertically, one character per line.

echo Print text vertically|sed 's/\(.\)/\1\n/g'
Sample Output
P
r
i
n
t
 
t
e
x
t
 
v
e
r
t
i
c
a
l
l
y

8
By: axelabs
2009-03-04 23:58:02

These Might Interest You

What Others Think

elegant
linuxrawkstar · 485 weeks and 1 day ago
... and the usefulness of this is...?
atoponce · 484 weeks and 5 days ago
I have had practical use for this. Needed to find all characters used in the texts for a computer game to make sure our font included all needed glyphs. Passed all texts through sed and then let "sort --unique" find all needed letters.
palmin · 372 weeks and 2 days ago
Another way to do this echo Print text vertically| fold -c1
garchacesaug · 356 weeks and 2 days ago
OS X's sed doesn't interpret \n in the replacement pattern, but you can use `sed $'s/./&\\\n/g'`. & is the matched pattern, like $& in Perl and Ruby. If LC_CTYPE is not already set to a UTF-8 locale, you can use `LC_CTYPE=UTF-8 sed` to make sed treat multibyte characters as single characters.
lri · 250 weeks and 3 days ago
@garchacesaug, wrong -c1, true -s1 echo Print text vertically | fold -s1
saherteam · 218 weeks and 1 day ago

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands



Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: