Skip to content

Instantly share code, notes, and snippets.

@havocesp
Created December 11, 2018 20:37
Show Gist options
  • Save havocesp/a3ea613f12c31b5a23ea549f7f3617a4 to your computer and use it in GitHub Desktop.
Save havocesp/a3ea613f12c31b5a23ea549f7f3617a4 to your computer and use it in GitHub Desktop.
Shell colors &styles with `tput`
# BASH Receipes
# ================================================================
# The "tput" magic
# ================================================================
tput bold # Bold effect
tput rev # Display inverse colors
tput sgr0 # Reset everything
tput setaf <code> # Set foreground color
tput setab <code> # Set background color
# ================================================================
# Various color codes for the tput command
# ================================================================
# Code Color
# ---- -----
# Black 0
# Red 1
3 Green 2
# Yellow 3
# Blue 4
# Magenta 5
# Cyan 7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment