Skip to Content
Linux Shell Scripting Cookbook - Third Edition
book

Linux Shell Scripting Cookbook - Third Edition

by Clif Flynt, Sarath Lakshman, Shantanu Tushar
May 2017
Beginner
552 pages
28h 47m
English
Packt Publishing
Content preview from Linux Shell Scripting Cookbook - Third Edition

How to do it...

Here are some capabilities of the tput command:

  • Return the number of columns and rows in a terminal:
        tput cols
        tput lines
  • Return the current terminal name:
        tput longname
  • Move the cursor to a 100,100 position:
        tput cup 100 100
  • Set the terminal background color:
        tput setb n

The value of n can be a value in the range of 0 to 7

  • Set the terminal foreground color:
        tput setf n

The value of n can be a value in the range of 0 to 7

Some commands including the common color ls may reset the foreground and background color.
  • Make text bold, using this command:
        tput bold
  • Perform start and end underlining:
        tput smul
        tput rmul
  • To delete from the cursor to the end of the line, use the following command: ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Mastering Linux Shell Scripting - Second Edition

Mastering Linux Shell Scripting - Second Edition

Mokhtar Ebrahim, Andrew Mallett

Publisher Resources

ISBN: 9781785881985