Foundever Technical Academy Percentage: 15%
Fundación Omar Dengo Total Points: 50 pts
Linux I Allotted time: 1 week (deadline
Prof. Lisseth Alemán G. provided by the instructor)
Midterm Lab
Full Name: __________________________________ Date: ________________
Obtained points: ________________ Grade: ________________
Welcome to this Midterm Lab. Make sure to read and follow the instructions below.
INSTRUCTIONS:
1. Carefully read each activity before performing it.
2. When required, capture a clear screenshot of your terminal output and place
it directly below the related task.
3. The point (s) will be granted only if the full instructions are followed.
4. The lab consists of nine pages, and it is divided into three parts.
5. Send back this document in an editable format to the following email
address [Link]@[Link] (must).
6. In case the evaluation is not sent into the allotted time, please provide your
justification via email to [Link]@[Link] (Academy Adviser) and
copying your instructor’s email to wait for the approval.
7. The expected outputs must be commands that were studied in class that are
included in the NetAcad curriculum.
8. The exam is shared in a .docx file for you to edit the content easily. A .pdf
version will be shared Via WhatsApp to consider it as the official version of
the evaluation. No edition of the items will be allowed.
9. Good Luck and have fun!
PART I: COMMAND LINE EXECUTION. Use your terminal to add a capture of the
desired output on each item. All the commands that should be executed were
covered in class. (50 points)
1. Create an alias named his10 that shows the last 10 used commands and
test it. (1 pt)
(Insert screenshot here)
2. Create a new file named [Link] and do a long listing of this file. (1 pt)
(Insert screenshot here)
2
3. List the contents in reverse alphabetical order of the following directories
/var/log/sysstat,/etc/gnome, and /run/cups. (1 pt)
(Insert screenshot here)
4. Display the command that provides system information including all details.
(1 pt)
(Insert screenshot here)
5. Go to your home directory and print the current/working directory. (1 pt)
(Insert screenshot here)
6. Display the command type information of the following commands: alias,
history, cat, and grep in a single instruction and including all its locations. (1
pt)
(Insert screenshot here)
7. Display the manual of the command tar and look for the word
“extract”. (1 pt)
(Insert screenshot here)
8. Show the man pages that match with the terms mv,cp, and echo in a
single instruction. (1 pt)
(Insert screenshot here)
9. Create a local variable named ice_cream and assign the value
“chocolate” in it. Then, display the content of the variable with echo. (1 pt)
(Insert screenshot here)
10. Create an environment variable named FAVORITE_PLANET and assign
your favorite planet as a value in it. Then, display the content of the variable with
echo. (1 pt)
(Insert screenshot here)
3
11. Create and export a variable named sea_creature and assign the value
‘shark’ in it. Then, display the content of the variable with echo. (1 pt)
(Insert screenshot here)
12. Use the env command and filter the variable sea_creature. (1 pt)
(Insert screenshot here)
13. Execute the bash command and then show the ice_cream and
sea_creature variables with echo. Explain why one of these variables
disappeared its content. (2 pts)
(Insert screenshot here)
(Insert explanation here)
14. Unset the variable sea_creature and display its content with echo. (1
pt)
(Insert screenshot here)
15. Display the contents of the PATH variable with echo. Add /etc/apt and
the contents of the PATH variable in the PATH variable. Then show the modification
of the PATH variable with echo. (1 pt)
(Insert screenshot here)
16. Update the PATH variable with the content of the variable PATH_BACKUP.
Display the PATH variable when modified with echo. (1 pt)
(Insert screenshot here)
17. Remove the PATH_BACKUP variable and then show its current content with
echo. (1 pt)
(Insert screenshot here)
4
18. Show the last 9 commands executed. (1 pt)
(Insert screenshot here)
19. Change the HISTSIZE to 777. Then, print the HISTSIZE variable with
echo. What is the function of the HISTSIZE variable? (2 pts)
(Insert screenshot here)
(Insert explanation here)
20. Go to your home directory and create a directory named Movies. Access
the Movies directory and create the directories action, horror, and drama.
Once created, execute the ls command. (1 pt)
(Insert screenshot here)
21. Access the horror directory and create the directories Saw, It, and
Insidious. Once created, execute the ls command. Then, access every
directory and create their corresponding files [Link], [Link],
[Link], [Link], [Link], [Link],
[Link], [Link], and [Link].
Once created, execute the ls command. (1 pt)
(Insert screenshot here)
22. Go to the Saw directory and list with echo the file(s) that could contain a V in
it using Globbing. (1 pt)
(Insert screenshot here)
23. Go to the Insidious directory and list with echo the file(s) that are in the
range of 1 to 2 in it using Globbing. (1 pt)
(Insert screenshot here)
24. Copy the file [Link] file to the Saw directory. Then, list the Saw
directory with ls. (1 pt)
(Insert screenshot here)
5
25. Go to the It directory and move the [Link] file to the Insidious directory
under the new file name [Link]. (1 pt)
(Insert screenshot here)
26. Remove the It directory and then list the horror directory with ls. (1 pt)
(Insert screenshot here)
27. Create a file named [Link] in the action directory. List the
file with the ls command. Then, use the locate command to show it. Why does
the locate command not show the file? (2 pts)
(Insert screenshot here)
(Insert explanation here)
28. Update the database of the locate command and then re-execute the
locate command again to visualize the [Link] file. (1 pt)
(Insert screenshot here)
29. Create a file named [Link] in the action directory. List the file with
the ls command. Then, use the find command to locate the file. (1 pt)
(Insert screenshot here)
30. Visualize the file /etc/gshadow listing the line numbers. Use admin
privileges to see the file content. (1 pt)
(Insert screenshot here)
31. By using the grep command and regular expressions, show the word
“root’’ in /etc/gshadow. Use admin privileges to see the file content. (1 pt)
(Insert screenshot here)
6
32. Go to the home directory, execute the date command and send the
standard output to a file named my_outputs.txt. Then display the content of
my_outputs.txt with cat. (1 pt)
(Insert screenshot here)
33. Execute the cal command with the year and month of your birthday and
append the standard output in my_outputs.txt. Then display the content of
my_outputs.txt with cat. (1 pt)
(Insert screenshot here)
34. Confirm you are in the home directory, execute abcdefg on the Command
line and send the standard error to a file named my_errors.txt. Then display
the content of my_errors.txt with cat. (1 pt)
(Insert screenshot here)
35. List all the current processes of your terminal and filter the first 5 lines with
the root user in a single line. (1 pt)
(Insert screenshot here)
36. Execute a command as a background process. Then, show the process
running in the background. (1 pt)
(Insert screenshot here)
37. Go to the action directory and compress the [Link] file with gzip.
Then, list the [Link] with ls. (1 pt)
(Insert screenshot here)
38. List the amount of compression of the [Link] file. (1 pt)
(Insert screenshot here)
7
39. Access the drama directory and create a file named
pride_and_prejudice.movie and then, list the
pride_and_prejudice.[Link] with ls. (1 pt)
(Insert screenshot here)
40. Go to the horror directory and tar the Insidious file in verbose mode.
Then, list the [Link] with ls. (1 pt)
(Insert screenshot here)
41. Un-tar the [Link] file in verbose mode and show results of the
un-tar with ls. (1 pt)
(Insert screenshot here)
42. Change your current session to root. Once you are logged in the root user,
execute ls. Then, go back to your regular user session. (1 pt)
(Insert screenshot here)
43. Go to the Saw directory and change the ownership of [Link] to root.
Then, show the results with ls -l. (1 pt)
(Insert screenshot here)
44. Add all permissions with the Symbolic Method to [Link]. Then,
show the results with ls -l. (1 pt)
(Insert screenshot here)
45. Remove all permissions with the Octal Method to [Link]. Then,
show the results with ls -l. (1 pt)
(Insert screenshot here)
46. Create a soft link of [Link] to the drama directory. Then, show the
results in the drama directory with ls -l. (1 pt)
8
(Insert screenshot here)
47. Create a hard link of [Link] in the action directory. Then, show the
results in the action directory with ls -l. (1 pt)
(Insert screenshot here)
(Insert explanation here)
PART II. TEXT MANIPULATION. (Optional) Use the text editor vi or vim and
complete the following tasks. (2% percentage of the final grade of the course)
1. Go to your home directory and create a file named [Link] and open it
on the text editor vi or vim. Copy and paste the lyrics of a song you like, save the
file and execute the cat command to read the content of the song. (1%)
(Insert screenshot here)
2. Use the grep command to filter a common word of the song with the cat
command. Then, show the first 10 lines of the text file. Make sure the lines are
numbered. (1%)
(Insert screenshot here)
9
Part III. SELF-EVALUATION. (Optional) Share an honest review of your own
performance during this exam. Include your strengths, challenges, and
emotions/reactions about this hands-on lab. (1% percentage of the final grade of
the course)
Strengths:_________________________________________________________
__________________________________________________________________
__________________________________________________________________
__________________________________________________________________
__________________________________________________________________
__________________________________________________________________
Challenges: _______________________________________________________
__________________________________________________________________
__________________________________________________________________
__________________________________________________________________
__________________________________________________________________
Emotions:_________________________________________________________
__________________________________________________________________
__________________________________________________________________
Other observations (if applicable):
__________________________________________________________________
__________________________________________________________________
__________________________________________________________
Feedback to the instructor? (if applicable):
__________________________________________________________________
__________________________________________________________________
_________________________________________________________________
“Wisdom is not a product of schooling but of the lifelong attempt
to acquire it.” ― Albert Einstein