Which character is used to represent the username in the PS1 prompt string?*1 pointa) %ub) %nc) %hd) %p
Question
Which character is used to represent the username in the PS1 prompt string?*1 pointa) %ub) %nc) %hd) %p
Solution
The character that is used to represent the username in the PS1 prompt string is %u. So, the correct answer is a) %u.
Similar Questions
How do you customize the PS1 prompt to display the current working directory?*1 pointa) PS1="%C"b) PS1="%d"c) PS1="%H"d) PS1="%P"
In Linux, what does the PS1 environment variable control?*1 pointa) System passwordb) Shell promptc) Disk spaced) User profile
Bourne Again Shell (bash), similarly to other UNIX shells utilises environmental variable PS1'' to store prompt string description. Willing to change it, it is enough to replace its value with a new one. The most permanently looking effect can be obtained by performing adequate substitution in start script, which in case of bash is in ~/.bash_profile'' file (~'' stands for the home directory of a user in question).Prompt string can contain sequences like \x'', where x - a character, which during printing of prompt will be interpreted and substituted with specific information, e.g. \t'' - actual time. Description of other standard sequences can be found in man page concerning bash (man bash).Task: Permanently set URL-like prompt of the form:
The first line should prompt the user to enter the primary string ('PS').The second line should ask for the character to be replaced ('c').The third line should request the replacement string ('s').
Which of the following characters in a shell prompt indicates the shell is running with root privileges?
Upgrade your grade with Knowee
Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.