Like this post? Please share to your friends:. Ubuntu is a complete Linux operating system, freely available with both community and professional. Press the Windows logo on your keyboard, or click the Windows icon in the. If you have a Ford model. This site uses cookies to store data. By continuing to use the site, you consent to the processing of these files.
Example1: We can change this prompt to different one with a bit meaning such as giving present time of the machine etc as shown in below example. If you see I set my PS1 prompt to use time 24 hour format by defining A option. You can use above mention codes to make your prompt more informative. Example2: Want to display a command output in your prompt? We can do that using command substitution concept. Suppose I want to display 'uname -r' output along the prompt, I can do that by setting PS1 as shown below.
Example3: How about using system inbuilt variables in the prompt? We can use that as well with PS1 prompt. Display number of seconds completed when the terminal opened. Example4: We can even use functions in the PS1 prompt.
Suppose you want to keep a check on RAM availability. And you can do many more with this prompt. I will leave this to users to explore more on this and enjoy. Create a free Team What is Teams? Learn more. Why is bash's prompt variable called PS1? Ask Question. Asked 9 years, 8 months ago. Active 9 years, 8 months ago.
Viewed 24k times. Improve this question. Olivier Lalonde Olivier Lalonde 4, 5 5 gold badges 21 21 silver badges 19 19 bronze badges. Add a comment. Active Oldest Votes. Improve this answer. AnsgarEsztermann, your comment could be an answer as well which I would vote up.
An example of its use is to change the prompt of the select command by first setting PS3, eg.
0コメント