Linux Administration Bootcamp: Go from Beginner to Advanced - Customizing the Shell Prompt

Linux Administration Bootcamp: Go from Beginner to Advanced - Customizing the Shell Prompt

Assessment

Interactive Video

Information Technology (IT), Architecture

University

Hard

Created by

Quizizz Content

FREE Resource

This video tutorial explains how to customize shell prompts across different systems and shells, focusing on bash, the most common shell for Linux users. It covers setting environment variables like PS1 for bash and prompt for other shells, and provides examples of formatting options. The tutorial also demonstrates how to make these customizations persistent across logins by editing initialization files. Practical examples show how to modify prompts to include information like username, host, and directory, and how to create multiline prompts.

Read more

7 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which environment variable is used to customize the primary prompt string in bash?

PS1

PROMPT

BASH_PROMPT

SHELL_PROMPT

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does the formatting string '\\H' display in a bash prompt?

Username

Short hostname

Fully qualified domain name

Current time

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does the formatting string '\\w' display in a bash prompt?

Username

Current working directory

Current time

Hostname

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How can you ensure that your customized bash prompt persists across logins?

By setting the prompt in the terminal each time

By using a special shell script

By adding the PS1 value to the bash_profile file

By using the 'save' command

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does the '~' symbol represent in a bash prompt?

Parent directory

Home directory

Root directory

Current directory

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which command can be used to edit the bash_profile file?

edit

prompt

nano

bash

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How can you create a multiline prompt in bash?

By editing the shell script

By using '\\n' in the PS1 variable

By setting multiple PS1 variables

By using a special multiline command