Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Lab Project 2 Due Jun 2 by 1 1 : 5 9 pm Points 3 0 Submitting a file upload Attempts 0 Allowed Attempts 1
Lab Project
Due Jun by :pm Points Submitting a file upload Attempts Allowed Attempts Available until Jun at :pm
The purpose of this lab project is to become more comfortable with the shell and shell commands. It consists of the following five parts:
PART : Experiment with some basic shell commands.
Open a terminal window on your Linux virtual machine.
Notice the shell prompt components: user@hostname:dir$
Use the pwd command to identify your location.
Use the cd command to get to the root of your directory tree structure.
Use the cd ~ command to get back to your user's home directory.
Take a screenshot filename: screenshot of the above activities.
Clear the shell with the clear command.
PART : Learn about commands to get help.
Use the man ls command to review the ls command. Type q to quit.
Use the info ls command to review the ls command. Take note of how this is different from the man command. Type q to quit.
Use the help command to find out more information about itself by typing in help help
Take a screenshot filename: screenshot of the above activities.
Clear the shell with the clear command.
PART : Learn about commands to navigate the directory tree structure while creating files and directories.
While in your user's home directory, use the ls l command to view the contents of the directory.
Take a mental note of which directories are part of the Linux Filesystem Hierarchy Standard FHS and those that are not refer back to the learning materials for this module
Use the mkdir test command to add a new directory in your home directory.
Use the cd command to change into the test directory that you just created in the previous step.
Use touch file to create a new empty file in the test directory.
Use the ls command with a single option flag to view the details of fileIf you can't remember which option is used to view the details, what can you do to view the available options for that command?
Use rm file to delete it
Exit the test directory and return to its parent directory.
Use rmdir test to delete it
Use the mkdir command to add a directory named test in your home directory.
Copy the etcpasswd file to the ~test directory so a copy of etcpasswd is stored at ~testpasswdbak
Use one command to verify that the copy of etcpasswd was successfully made to ~testpasswdbak while also indicating that it is not empty. The output of this command must consist of only two short lines.
Take a screenshot filename: screenshot of the above activities.
Clear the shell with the clear command.
PART : Learn about commands used to view the contents of files.
Use the cat command to review the contents of the ~testpasswdbak
Take a screenshot filename: screenshot of the above activity.
Clear the shell with the clear command.
Resize your terminal window to make it half of the height that it was before by dragging the bottom of the window up
Now try step again, but use the less command instead of cat. Use the up and down arrow keys to scroll through the file, type in q to exit less.
Return your terminal window to its previous height by dragging the bottom of the window down.
Now try step again, but use the head command instead of cat.
Now try step again, but use the tail command instead of cat.
Try steps and again, but add the n optionflag to the head and tail commands and see what happens.
Type cat file and enter a single sentence about how you feel about Linux. Hit Enter and then type CTRL d to exit.
Type cat file to view its contents.
Create another file with this command ls la ~ file
Append to the end of file the contents of ~testpasswdbak using this command cat ~testpasswdbak file
Review the final contents of file your work using the less command. You should remember how to exit less.
Search file for any lines with the word root by using this command: grep root file
Take a screenshot filename: screenshot of the above activities.
Clear the shell with the clear command.
PART : Try out some new commands!
w
who
whoami
cal
date
date Y
let linuxage$date Y
echo 'Linux is $linuxage 'years old! birthday
cat birthday
cat birthday wc
env grep PATH
groups
id
uname a
hostname
shutdown before entering this command, be prepared to type in the next command very quickly afterward within seconds!
shutdown c
Take a screenshot filename: screenshot of the above activities.
After taking this screenshot, if you are unsure what the previous commands are used for based on their output, go back and review the man page for the ones you are unsure about.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started