How do I change my PS1 command prompt in Bash?
I have read about 15 chapters of your book (Teach Yourself UNIX in 24 Hours) so far. We are using vi. On the PS1 command, how do I see what is in it so I can add to it and not change what is already there? We are using bash. What I see now is: ctdaywbsdv:/u/gwilki$
When I enter ‘echo $PS1’ I get: $ \[\e[0m\]
How do I keep the above and add the histcmd option? What does the \e and 0m\ mean? What do the  the square brackets mean? I can’t find a man page for PS1. How do I find the rest of the options for this PS1?
You're right that there's no man page for the PS1 prompt setting in Bash, but the bash man page itself (type man bash) is incredibly long, and one section explains all the features and capabilities of the PS1 prompt variable. In that it notes, for example, that:
The value of this parameter is expanded (see PROMPTING below) and used as the primary prompt string. The default value is \s-\v\$
Going down to the section labeled PROMPTING, it explains all the different variables you can utilize to set or customize your own Bash prompt. It's incredibly long:
To see the current value of your prompt, just type echo $PS1 in the Bash shell. To change it, simply change the value of that variable. To make the change automatic each time you log in, add that to your ~/.profile and it's done.
Now you have enough information to learn what the \e and \0m mean too. The former is the ASCII escape character and is likely being used to start a sequence to put your prompt in bold or inverse video, and \0m is indeed the sequence required to do just that, it's the \000 format being used.
I hope that helps you fine-tune your Bash prompt as needed!
More Useful Unix and Linux Help Articles:
✔ Copy and Paste from the Mac OS X Command Line?
I am constantly running commands in Terminal.app on my MacBook and then copying and pasting the results into email messages or documents. Yes,...✔ Shell script to convert lowercase to title case?
As part of a project I'm working on, I find myself deep in a Linux shell script, needing to have a subroutine that...✔ Can I script renaming files based on an XML data map?
I have a folder full of files which are named with four digits and a file extension e.g. 0312.file and an XML-file describing...✔ Test for valid numbers in a Bash shell script?
In a different discussion on this site [see Redirecting input in a shell script] a visitor commented that "I was too busy trying...✔ Review: iSSH for the iPad/iPhone
If you're running an online business like I am, there are times when you need to connect and log in to the server...
Let's stay in touch!
Sign up for my weekly AskDaveTaylor Newsletter and you'll receive even more tech and gadget help right to your inbox, along with exclusive news and industry updates. It's good stuff. I promise!
I do have a comment, now that you mention it!
Check This Out Too...
Look for Answers
All Our Categories
Apple iPad Help
Articles and Reviews
Auctions and Online Shopping
Blogs and Blogging
Building Web Site Traffic
Business and Management
Computer and Internet Basics
d) None of the Above
Google Gmail Help
Google Plus Help
Industry News and Trade Shows
iPhone and Cell Phone Help
iPod, Sony PSP and MP3 Player Help
Kindle Fire Help
Mac OS X Help
Pay Per Click (PPC) Advertising
Search Engine Optimization (SEO)
Shell Script Programming
Tech Support Video Help
The Writing Business
Twitter, LinkedIn and Social Network Help
Unix and Linux Help
Video Game Tips and Help
Windows PC Help
Find Me on Google+
ADT on G+