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

How can I make some output bold in Ubuntu terminal

echo "text bold text"

text bold text

or the same from

cat my_file
share|improve this question
up vote 22 down vote accepted

Here's how:

echo -e "text \033[1mbold\033[0m text"

See "Colorizing" Scripts tutorial.

It's not possible to do for cat that way. cat will merely print the characters of the file onto standard out. The closest thing I can come up with is the following:

If you put text \033[1mbold\033[0m text you can do

echo -e `cat test.txt`
share|improve this answer
what I wanted in cat is the same. I do 'echo -e "text \033[1mbold\033[0m text" > myfile' and then 'cat myfile' thank you for showing this. – varsketiz May 26 '11 at 9:07
More generally, "echo $(tput bold)" and "echo $(tput sgr0)" will work for any terminal, not just ANSI/VTxxx-compatible ones. – njd May 26 '11 at 10:28
@njd, ah, good point. – aioobe May 26 '11 at 10:31

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.