Here's how to change your Linux command prompt to something you might like better. Credit: Sinemaslow / Getty Images The command prompt in a Linux terminal window is often just a $ unless you’ve logged in or sudo’ed your way into the root account, in which case you’d expect a #. Sometimes, though, your prompt will be more complicated, with a format like [lucky@fedora ~]$. But it’s possible to change your prompt to some friendlier character, word, or phrase, and if you’re so inclined, you can even change its color. This post shows how easy it is to make these kinds of changes. Changing the format To get started, one thing you need to know is that your command prompt is not just something your shell creates on the fly. Instead, it’s a variable and its name is PS1. To see how your prompt is defined, display its value like this: -bash-5.1$ echo $PS1 s-v$ In the case shown above, the prompt contains the name of the shell (bash) and its version (5.1). That’s what those letters (s and v) indicate when you look at how it’s defined. To change to this format, you would use a command like this: $ PS1="s-v$ " Another often-used prompt format includes the username and hostname as in the example below. [jdoe@fedora ~]$ echo $PS1 [u@h W]$ You would use a command like the one below to change your prompt to this format. PS1="[u@h W]$ " To change to simply a dollar sign, do this: $ PS1="$ " Keep in mind that the blank at the end of these prompt definitions is needed to separate the prompt from the commands that you will be typing. Changing the text While most Linux users stick with one of the standard prompts, there’s nothing that says you must. If you prefer a “>” or a “?”, that will work. $ PS1="> " $ PS1="? " In fact, you can be creative with your prompt. $ PS1="What now?> " $ PS1="Ready for a break?> " To change your prompt to include the date in mm/dd/yy format, use a command like this one: PS1="`date +%D`> " Changing the color To change your prompt to a different color, you have to first identify the color you want to use and express it to bash or whatever shell you are using in a way that it can understand. When I change my prompt to “yes?> ” in a lively purple font, I use a command like this: PS1="[ Related content how-to How to examine files on Linux Linux provides very useful options for viewing file attributes, such as owners and permissions, as well as file content. By Sandra Henry Stocker Oct 24, 2024 6 mins Linux how-to 8 easy ways to reuse commands on Linux Typing the same command again and again can become tiresome. Here are a number of ways you can make repeating commands – or repeating commands but with some changes – a lot easier than you might expect. By Sandra Henry-Stocker Oct 15, 2024 5 mins Linux news SUSE Edge upgrade targets Kubernetes and Linux at the edge SUSE Edge 3.1 includes a new stack validation framework and an image builder tool that are aimed at improving the scalability and manageability of complex Kubernetes and Linux edge-computing deployments. By Sean Michael Kerner Oct 15, 2024 6 mins Edge Computing Linux Network Management Software how-to Lesser-known xargs command is a versatile time saver Boost your Linux command line options and simplify your work with xargs, a handy tool for a number of data manipulation tasks. By Sandra Henry Stocker Oct 11, 2024 6 mins Linux PODCASTS VIDEOS RESOURCES EVENTS NEWSLETTERS Newsletter Promo Module Test Description for newsletter promo module. Please enter a valid email address Subscribe