Introduction to Linux UNIX DCOM 142 Final Project Overview: This final is a practical based activity covering areas of L
Posted: Fri May 20, 2022 3:38 pm
Introduction to Linux UNIX
DCOM 142 Final Project
Overview: This final is a practical based activity covering
areas of Linux from throughout the semester. Read each section
carefully and thoroughly before executing the tasks within the
section. Remember, you have access to the any book(s),
self-prepared notes, the internet, and the system's help, man, and
info pages.
Some tasks will require root access using the sudo command.
This Final will assume that you are logged in as the student
user.
When completed properly, you should not see any error messages
from the commands run. If you are seeing errors, check to make sure
you are performing the task correctly.
Remember that Linux commands and file/directory names are case
sensitive. Full credit will not be awarded if files or directories
are spelled incorrectly.
Graphical tools can be used but will make it harder for me to
give partial credit.
Be certain you are working in your own Virtual Machine as the
student user!
Section 0: Initial Preparation
1. Click VM. Click Snapshot. Click Take snapshot. Name it
Final
2. Change to your home directory.
3. Change the hostname of your CentOS Linux to your last name by
typing this command
sudo hostnamectl set-hostname
sudo systemctl restart system-hostnamed
reboot or restart your CentOS and
verify the host name is changed when you open the terminal
Section 1: User Management
Create the following users: mickey, miney, pluto,
donald, goofy.
Note: One screenshot (one command not multiple commands)
is needed to show that all five users are added. Points will be
taken off if multiple screen shots are shown
[Paste Screen Shot ]
Set the passwords for the above users to
abc1234
One screenshot ((one command not multiple commands) is
needed to show that all five users passwords are added. Points will
be taken off if multiple screen shots are shown
[Paste Screen Shot]
Group Management
a. Create the
following groups: disney, xbox, playstation
b. Add the following
users to the group disney: miney, pluto,
goofy
c. Add the following
users to the group xbox: donald,
mickey
d. Add the following
users to the group playstation: student
One screenshot ((one command not multiple commands) is
needed to show that all groups are added. Points will be taken off
if multiple screen shots are shown
[Paste Screen Shot]
Section 2: Bash Scripting
1.
Create a simple bash
script in your home directory, with the filename
script.sh, to accomplish the following tasks:
2.
Set the variable
FAKEYEAR equal to 2021
3.
Ask the user what the
current year is, and store it in the variable
REALYEAR
4.
Print the message “The
current year is” followed by the contents of the
FAKEYEAR variable
5.
Print the message “No,
that isn't right. It's really“ followed by the contents of the
REALYEAR variable
6. Print the
message “Your username is ____ and your home directory is _____”,
filling in the blanks with the built-in USER and
HOME variables.
7.
Run this script and make
sure it works as expected.
Required for grading:
Paste the screen shot of the content script.sh and
output of running script.sh
Section 3 –Searching Inside Files
Note: This section requires the
/usr/share/dict/words file. If the file
/usr/share/dict/words does not exist, run the following
command:
sudo yum install words
or
sudo yum -y install words
--disablerepo=my-internal-repo
1.
Find how many lines are
inside of the /usr/share/dict/words file. Save the
number of lines to a file named words.txt in your
home directory.
2.
Search the
/usr/share/dict/words file for all words
containing “egg-white”. Append all words
containing “egg-white” to a file named
words.txt in your home directory.
3.
Search the
/usr/share/dict/words file for all words containing
“veggies”. Count and append and save the number of
words containing “veggies” to a file named
words.txt in your home directory.
Attach contents of words.txt file screen shot stored in
your home directory.
Section 4 – Script 2
1.
Create a script called
user.sh. This script should:
a) prompt the user to enter their
username
b) check to see if the username is the
currently logged in username. If it is not, the script should print
an error message and exit. If it is the correct user, the script
should print a welcome message to the user.
2. Save the file as
user.sh and run this script and make sure it works
as expected.
3.
Re-run this script with
user.sh | tee user.txt so that the output is both
shown on the screen and saved to ~/user.txt <>
Required for grading:
Paste the screen shot of the contents of user.sh and output of
running user.sh
Extra Credit (10pts)
1.
Create a script called
count.sh. This script will output the numbers 1 through 10. The
echo command is not permitted in this script.
2.
Save the file as
count.sh and use one of the options to run the
script.
3.
Run this script and make
sure it works as expected.
4. Re-run this
script with count.sh | tee count.txt so that the
output is both shown on the screen and saved to
count.txt
Show the screen shot
Required for grading:
Paste the screen shot of the contents of count.sh and output of
running count.sh
DCOM 142 Final Project
Overview: This final is a practical based activity covering
areas of Linux from throughout the semester. Read each section
carefully and thoroughly before executing the tasks within the
section. Remember, you have access to the any book(s),
self-prepared notes, the internet, and the system's help, man, and
info pages.
Some tasks will require root access using the sudo command.
This Final will assume that you are logged in as the student
user.
When completed properly, you should not see any error messages
from the commands run. If you are seeing errors, check to make sure
you are performing the task correctly.
Remember that Linux commands and file/directory names are case
sensitive. Full credit will not be awarded if files or directories
are spelled incorrectly.
Graphical tools can be used but will make it harder for me to
give partial credit.
Be certain you are working in your own Virtual Machine as the
student user!
Section 0: Initial Preparation
1. Click VM. Click Snapshot. Click Take snapshot. Name it
Final
2. Change to your home directory.
3. Change the hostname of your CentOS Linux to your last name by
typing this command
sudo hostnamectl set-hostname
sudo systemctl restart system-hostnamed
reboot or restart your CentOS and
verify the host name is changed when you open the terminal
Section 1: User Management
Create the following users: mickey, miney, pluto,
donald, goofy.
Note: One screenshot (one command not multiple commands)
is needed to show that all five users are added. Points will be
taken off if multiple screen shots are shown
[Paste Screen Shot ]
Set the passwords for the above users to
abc1234
One screenshot ((one command not multiple commands) is
needed to show that all five users passwords are added. Points will
be taken off if multiple screen shots are shown
[Paste Screen Shot]
Group Management
a. Create the
following groups: disney, xbox, playstation
b. Add the following
users to the group disney: miney, pluto,
goofy
c. Add the following
users to the group xbox: donald,
mickey
d. Add the following
users to the group playstation: student
One screenshot ((one command not multiple commands) is
needed to show that all groups are added. Points will be taken off
if multiple screen shots are shown
[Paste Screen Shot]
Section 2: Bash Scripting
1.
Create a simple bash
script in your home directory, with the filename
script.sh, to accomplish the following tasks:
2.
Set the variable
FAKEYEAR equal to 2021
3.
Ask the user what the
current year is, and store it in the variable
REALYEAR
4.
Print the message “The
current year is” followed by the contents of the
FAKEYEAR variable
5.
Print the message “No,
that isn't right. It's really“ followed by the contents of the
REALYEAR variable
6. Print the
message “Your username is ____ and your home directory is _____”,
filling in the blanks with the built-in USER and
HOME variables.
7.
Run this script and make
sure it works as expected.
Required for grading:
Paste the screen shot of the content script.sh and
output of running script.sh
Section 3 –Searching Inside Files
Note: This section requires the
/usr/share/dict/words file. If the file
/usr/share/dict/words does not exist, run the following
command:
sudo yum install words
or
sudo yum -y install words
--disablerepo=my-internal-repo
1.
Find how many lines are
inside of the /usr/share/dict/words file. Save the
number of lines to a file named words.txt in your
home directory.
2.
Search the
/usr/share/dict/words file for all words
containing “egg-white”. Append all words
containing “egg-white” to a file named
words.txt in your home directory.
3.
Search the
/usr/share/dict/words file for all words containing
“veggies”. Count and append and save the number of
words containing “veggies” to a file named
words.txt in your home directory.
Attach contents of words.txt file screen shot stored in
your home directory.
Section 4 – Script 2
1.
Create a script called
user.sh. This script should:
a) prompt the user to enter their
username
b) check to see if the username is the
currently logged in username. If it is not, the script should print
an error message and exit. If it is the correct user, the script
should print a welcome message to the user.
2. Save the file as
user.sh and run this script and make sure it works
as expected.
3.
Re-run this script with
user.sh | tee user.txt so that the output is both
shown on the screen and saved to ~/user.txt <>
Required for grading:
Paste the screen shot of the contents of user.sh and output of
running user.sh
Extra Credit (10pts)
1.
Create a script called
count.sh. This script will output the numbers 1 through 10. The
echo command is not permitted in this script.
2.
Save the file as
count.sh and use one of the options to run the
script.
3.
Run this script and make
sure it works as expected.
4. Re-run this
script with count.sh | tee count.txt so that the
output is both shown on the screen and saved to
count.txt
Show the screen shot
Required for grading:
Paste the screen shot of the contents of count.sh and output of
running count.sh