4/9/25, 10:40 AM 04-lab-working-with-shell.
md
Lab - Working with shell
Access Hands-On Labs here Hands-On-Labs
1. To check the home directory for a particular user say bob
$ grep bob /etc/passwd | cut -d ":" -f6
2. To check the home directory for a particular user using built in shell variables
$ echo $HOME
3. In the command echo Welcome, what does the word Welcome represent with respect to the
command?
$ echo Welcome
- Where Welcome is an argument
4. To check git command type
$ type git
5. To create a directory
$ mkdir /home/bob/birds
6. To create directories recursively
$ mkdir -p /home/bob/fish/salmon
7. Create few more directories
$ mkdir -p /home/bob/mammals/elephant
$ mkdir -p /home/bob/mammals/monkey
$ mkdir /home/bob/birds/eagle
$ mkdir -p /home/bob/reptile/snake
[Link] kodekloud/linux-basics-course/docs/02-Working-With-Shell-Part-I/[Link] 1/2
4/9/25, 10:40 AM [Link]
$ mkdir -p /home/bob/reptile/frog
$ mkdir -p /home/bob/amphibian/salamander
8. To move a directory
$ mv /home/bob/reptile/frog /home/bob/amphibian
9. To rename a directory
$ mv /home/bob/reptile/snake /home/bob/reptile/crocodile
10. To delete a directory
$ rm -r /home/bob/reptile
[Link] kodekloud/linux-basics-course/docs/02-Working-With-Shell-Part-I/[Link] 2/2