Question

3) Color We will play with PS1 prompts color. Please make your PS1 prompt: a text format: bold (See Linux/Unix Color Code Ta
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Linux command to edit PS1:

export PS1="\[\033[01;36;41m\]\u@\h \w\$\[\033[00;37;40m\] "

Understanding the above command:

export PS1="\[\033[01;36;41m\]\u@\h \w\$\[\033[00;37;40m\] "

\[\033 - starts a color scheme
[01;36;41 - sets font to bold (01), foreground color to Cyan (36), and background color to Red (41)
m\] - stops the color scheme

Now, since we only want to change color of the prompt and not the whole terminal, therefore, we again
need to start another color scheme after '$' of the prompt.

[00;37;40 - sets font back to normal (00), foreground color to White (37), and background color to Black (40)

Prompt before editing PS1:

shubham@DESKTOP-RBUJ4KN: ~ X shubham@DESKTOP - RBUJ4KN: $ echo $PS1 N[ \e]0;\u@\h: \w\a\]${debian_chroot:+($debian_chroot)}\[

Prompt after editing PS1:

shubham@DESKTOP-RBUJ4KN: shubham@DESKTOP-RBUJ4KN: $ export PS1=\[\€33[01;36;41m\] \u@\h_\w\$\[\033 [00; 37 ; 40m\ shubham@DE

FOR ANY HELP JUST DROP A COMMENT

Add a comment
Know the answer?
Add Answer to:
3) Color We will play with PS1 prompt's color. Please make your PS1 prompt: a text...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • JUDY'S HTML TUTORIAL MENU CREATING YOUR FIRST WEB PAGE The best way to make a web...

    JUDY'S HTML TUTORIAL MENU CREATING YOUR FIRST WEB PAGE The best way to make a web page is to just dive right in. Open Notepad. To open notepad in Windows, click the windows icon in the lower left corner of the screen and then type "notepad." Notepad is a text editor. Other text editors you may consider are TextPad, Sublime Text, or NotePad++. Do not use Word or WordPad; they are word processors. If you are using an Apple computer...

  • could you please help me with this problem, also I need a little text so I...

    could you please help me with this problem, also I need a little text so I can understand how you solved the problem? import java.io.File; import java.util.Scanner; /** * This program lists the files in a directory specified by * the user. The user is asked to type in a directory name. * If the name entered by the user is not a directory, a * message is printed and the program ends. */ public class DirectoryList { public static...

  • Actions that damage a company and its employees should be stamped out, everyone would agree. But ...

    Actions that damage a company and its employees should be stamped out, everyone would agree. But should the people responsible be stamped out, too? HBR CASE STUDY The Reign of Zero Tolerance by Ben Gerson "Mr. Pemberton?" manager. The guards had radioed her that the "Yes, that's me," Simon replied distractedly, his back turned. target wasn't putting up much resistance. "Your personal belongings will be messen The two burly gentlemen who had suddenly gered to your home later today," Sallie...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT