In Linux, what does the PS1 environment variable control?*1 pointa) System passwordb) Shell promptc) Disk spaced) User profile
Question
In Linux, what does the PS1 environment variable control?
1 point
a) System password
b) Shell prompt
c) Disk space
d) User profile
Solution
Understanding the PS1 Environment Variable
The PS1 environment variable in Linux is a key component in the shell environment, specifically controlling the appearance of the command prompt.
-
Definition: The PS1 variable determines how the primary command prompt looks in the terminal. It defines the format and the information displayed each time the user is prompted to enter a command.
-
Customization: Users can customize their PS1 variable to include various pieces of information such as the username, hostname, current working directory, and more. The default value often includes elements like
\u
(username),\h
(hostname), and\w
(current directory). -
Example: A typical PS1 value might look like this:
PS1='\u@\h:\w\$ '
This example would present the prompt in the form of
username@hostname:current_directory$
.
Final Answer
The correct answer is b) Shell prompt.
Similar Questions
Which character is used to represent the username in the PS1 prompt string?*1 pointa) %ub) %nc) %hd) %p
Which of the following characters in a shell prompt indicates the shell is running with root privileges?
7.____ command is used by the superuser for changing root’s password.*1 pointa) pdb) passwordc) pswdd) pwd
What command will show us the current enviorment paths that is tied to a user in Windows?
Where is the user password stored?0.5 Marks/etc/shadow/etc/password/root/password/etc/passwd
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.