0% found this document useful (0 votes)
5 views1 page

Linux Bash Shell Lab Guide

The document provides a lab guide for using the Linux Bash Shell, including commands to check the default shell, change a user's shell, create and persist environment variables, and set aliases. It also covers updating the prompt format for a user. Each command is illustrated with the appropriate syntax for execution in the terminal.

Uploaded by

crchd1963
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views1 page

Linux Bash Shell Lab Guide

The document provides a lab guide for using the Linux Bash Shell, including commands to check the default shell, change a user's shell, create and persist environment variables, and set aliases. It also covers updating the prompt format for a user. Each command is illustrated with the appropriate syntax for execution in the terminal.

Uploaded by

crchd1963
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

4/9/25, 10:41 AM 06-Lab-Linux-Bash-Shell.

md

Lab - Linux Bash Shell


Access Hands-On Labs here Hands-On Labs

1. To check the default shell for the current user. Display the shell for the current user but not necessarily
the shell that is running at the movement.

$ echo $SHELL

2. To change the shell for bob from Bash to Bourne Shell

$ chsh -s /bin/sh bob

3. What is the value of the environment variable TERM

echo $TERM

4. Create a new environment variable called PROJECT=MERCURY and make it persistent by adding the
variable to the ~/.profile file.

echo export PROJECT=MERCURY >> ~/.profile

5. Which of the following directories is not part of the PATH variable?

/opt/caleston-code

6. Set an alias called up for the command uptime and make it persistent by adding to ~/.profile file.

echo alias up=uptime >> ~/.profile

7. Update Bob's prompt so that it displays the date as per the format below: Example: [Wed Apr
22]bob@caleston-lp10:~$ Make sure the change is made persistent.

PS1='[\d]\u@\h:\w\$'
or
echo 'PS1=[\d]\u@\h:\w$' >> ~/.profile

[Link] kodekloud/linux-basics-course/docs/02-Working-With-Shell-Part-I/[Link] 1/1

You might also like