Shell Programming Blog Shell Programming Blog

Sunday, 30 September 2012

How to display the text in Bold and Underline in Linux

abu sittik | 03:42 |


 


 To display the test in "BOLD" and "UNDERLINE", the following ANSI Escape Sequences can be used.

To display the text in BOLD
$ echo -e "\033[1mThis is a BOLD line\033[0m"
This is a BOLD line

#Using tput
$ tput bold
$ echo "This"     #BOLD
$ tput sgr0     #Reset text attributes to normal without clear.
$ echo "This"     #NORMAL

To display the text in UNDERLINE
$ echo -e "\033[4mThis is an underlined line.\033[0m"
This is an underlined line.

3 comments:

Don't just read and walk away, Your Feedback Is Always Appreciated. I will try to reply to your queries as soon as time allows.

Note:
1. If your question is unrelated to this article, please use our Facebook Page.
2. Please always make use of your name in the comment box instead of anonymous so that i can respond to you through your name and don't make use of Names such as "Admin" or "ADMIN" if you want your Comment to be published.
3. Please do not spam, spam comments will be deleted immediately upon my review.

Regards,
Mohamed Abubakar Sittik A

 

Shell Programming Copyright © 2012 Shell Programming theme is Designed by Abusittik, Shell Programming