Here’s an example of how to set a red prompt:
PS1=$'\e[0;31m$ \e[0m'
The magic is the \e[0;31m
(turn on red foreground) and \e[0m
(turn off character attributes). These are called escape sequences. Different escape sequences give you different results, from absolute cursor positioning, to color, to being able to change the title bar of your window, and so on.
For more on escape sequences, see the wikipedia entry on ANSI escape codes
Related Posts:
- How can I convert MP3 file to a Base64 encoded string? [closed]
- What is a sanity test/check
- What is an instance variable in Java?
- Discord music bot not working
- Python Math – TypeError: ‘NoneType’ object is not subscriptable
- TCP vs UDP – What is a TCP connection? [duplicate]
- ssh : Permission denied (publickey,gssapi-with-mic)
- Error in “MLSD” command While Connecting FTP to Server [closed]
- Java default constructor
- How do I make a delay in Java?
- did you specify the right host or port? error on Kubernetes
- How does Java’s PriorityQueue differ from a min-heap?
- How can I sort a dictionary by key?
- What does ERR_SPDY_PROTOCOL_ERROR mean in nginx?
- What is a bitmask and a mask?
- C++ code file extension? What is the difference between .cc and .cpp
- How to remove origin from git repository
- XPath contains(text(),’some string’) doesn’t work when used with node with more than one Text subnode
- Should you use rgba(0, 0, 0, 0) or rgba(255, 255, 255, 0) for transparency in CSS?
- Transport endpoint is not connected
- How to convert .crt to .pem [duplicate]
- Ping – Request timed out
- How do I remove version tracking from a project cloned from git?
- How do I correctly clean up a Python object?
- How do I split a string on a delimiter in Bash?
- Why does Wi-Fi have so much more bandwidth than Bluetooth?
- What is a Ray ID (Cloudflare)?
- How do I get a list of built-in data sets in R?
- java.text.ParseException: Unparseable date
- Difference between .o and .ko file
- R error: all arguments must have the same length
- spring @sqlgroup with multiple datasource
- Change color of PNG image via CSS?
- How to set the text color of TextView in code?
- How do I install the OpenSSL libraries on Ubuntu?
- How can I specify a display?
- Clearing localStorage in javascript?
- Search all the occurrences of a string in the entire project in Android Studio
- “docker build” requires exactly 1 argument(s)
- declaring a priority_queue in c++ with a custom comparator
- Android java.lang.IllegalStateException: Could not execute method of the activity
- SwiftUI – How do I change the background color of a View?
- How to resolve the error java.net.SocketException: Too many open files
- Using map in Haskell
- RGB to hex and hex to RGB
- How to one hot encode several categorical variables in R
- cannot load such file — bundler/setup (LoadError)
- “webxml attribute is required” error in Maven
- Arithmetic Overflow in mips
- How to change angular port from 4200 to any other
- Render HTML string as real HTML in a React component
- How to draw lines in Java
- Styling Select Drop down box
- NoClassDefFoundError in Java: com/google/common/base/Function
- Where are the ampersand and vertical bar characters used in Python?
- Which font is used in MS-DOS?
- Google Gmail – “The conversation that you requested could not be loaded”
- apt-get for Cygwin?
- What is “pass-by-name” and how does it work exactly?
- is it possible to get the MAC address for machine using nmap
- Import error No module named skimage
- Why define PI = 4*ATAN(1.d0)
- How do I update zsh to the latest version?
- mport win32ui in python 3.6
- Empty functions in Javascript
- Solr: how to delete a collection?
- How to print a int64_t type in C
- How to store data in the flash memory of a Arduino Uno (ATmega328p)
- What is a blob URL and why it is used?
- Call to undefined function `get_plugin_data()`
- Contact Form 7 – Execute code AFTER mail send [closed]
- How to apply a patch?
- TwentyTwentyTwo – How to add PHP logic to Post templates?
- Maintenance holding page while migrating website
- Multiple og:image for Facebook
- How to get a current post’s blog id
- Rendering javascript in render_callback php Code
- Will has_category be true is used on index and one of queried posts has the category?
- Exclude categories with only sticky posts OR count sticky post of specific category
- What is a Pem file and how does it differ from other OpenSSL Generated Key File Formats?
- How to set environment variable in systemd service?
- Symlink not updating as expected when using an absolute with relative path
- How to include multiple domains in an spf TXT Record
- Physically locating the server
- Good tools that fit on a thumb drive [closed]
- How do you answer yes for yum install automatically
- All servers flooded by salt water, is it possible to recover data from multi-platter drives?
- How to check if I’m in screen session?
- How to zip/unzip files in Powershell?
- Cooling Server Closet – No A/C Is Possible
- Is it better practice to buy RAID disks individually vs. in bulk?
- What range of MAC addresses can I safely use for my virtual machines?
- What sysadmin things should every programmer know?
- Why do systems generally disable virtualization by default in BIOS settings?
- 10 servers to administer and I’m a history major [closed]
- Making `wget` not save the page
- How do I list all connected Salt Stack minions?
- How to get Apache2 to redirect to a subdirectory
- What does that mean: packages excluded due to repository priority protections
- How can I set a short timeout with the ping command?