
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!
Help others find this article at Del.icio.us, Digg, Netscape, Reddit, and Simpy.
Categorized:
Unix and Linux Help
(Article 7458)
Tagged: bash, command shells, linux, unix Previous: How do I change my return address in Google Gmail? Next: Should I buy links from sites with higher PageRank? Subscribe!
Never miss another useful Q&A article again! Subscribe to AskDaveTaylor with Google Reader. can you get a cds music on the psp Posted by: hvjadsf dfg at July 23, 2007 7:28 PMI have a lot to say, but ...
I do have a comment, now that you mention it!
|
Search
Find just the answers you seek from among our 1700+ free tech support articles by using our Lijit search engine.
Help!
Subscribe to
Ask Dave Taylor!
Free Updates!
Sign up and get free weekly updates and special offers on books, seminars, workshops and more.
Articles and Reviews
Auctions and Online Shopping Blogs and RSS Feeds Building Web site traffic Business and Management Cell Phones and Mobile Phones CGI Scripts and Web Site Programming Computer and Internet Basics d) None of the Above HTML and CSS Mac OS X Help MySpace, Facebook, Twitter and Social Network Help Pay Per Click (PPC) Search Engine Optimization Shell Script Programming Sony PSP, MP3 Players, Etc. The Writing Business Unix and Linux Help Video Game Tips and Help Windows Help
Recent Entries
Join the List!
Book Links
|