0% found this document useful (0 votes)
6 views9 pages

Linux I Midterm Lab Instructions

The document outlines the instructions and tasks for a Midterm Lab in a Linux I course, detailing activities to be completed within a week for a total of 50 points. It includes command line execution tasks, text manipulation exercises, and a self-evaluation section. Students are required to submit their work via email and follow specific guidelines for capturing and presenting their terminal outputs.

Uploaded by

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

Linux I Midterm Lab Instructions

The document outlines the instructions and tasks for a Midterm Lab in a Linux I course, detailing activities to be completed within a week for a total of 50 points. It includes command line execution tasks, text manipulation exercises, and a self-evaluation section. Students are required to submit their work via email and follow specific guidelines for capturing and presenting their terminal outputs.

Uploaded by

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

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

Common questions

Powered by AI

Updating the 'locate' command database in Linux is necessary because 'locate' searches are based on a precompiled database of files. The 'updatedb' command is used to refresh this database. Without regular updates, 'locate' may not find recently added or moved files. This process ensures accurate file searches, thereby streamlining file management and retrieval tasks .

Efficient directory navigation using the 'cd' command enhances productivity by quickly accessing required files and directories, reducing the time spent on searching or browsing through the file system. Best practices include using relative paths, maintaining an organized directory structure, and utilizing shortcuts and aliases to streamline navigation .

Command line output redirection in Linux allows users to capture command output into files or other commands, which is crucial for managing logs and outputs. It facilitates systematic record-keeping, error tracking through separate error logs, and complex automation tasks by chaining commands. This capability enhances efficiency and organization in system administration .

Using the 'grep' command with regular expressions is advantageous in scenarios that require pattern matching within text files, such as log analysis, data extraction, and filtering specific information. It is particularly useful for searching for complex patterns and strings, allowing for precise text processing and manipulation, even in large datasets .

Environment variables in Linux impact session persistence by storing data that can be accessed by processes throughout a user session. Exporting a variable makes it available to all child processes of the session, meaning it retains its value across different commands and scripts until the session ends. Without exporting, a variable set in a script or shell remains local to that script or shell only .

The HISTSIZE variable in Linux determines the number of commands to retain in the history list. Increasing its value allows more commands to be saved, which is useful for maintaining a comprehensive command history, aiding in efficient command recall and auditing. Conversely, a lower HISTSIZE limits the number of saved commands, potentially losing valuable command history over time .

Changing file ownership in Linux affects who can access and modify a file, which is crucial for security and access management. Assigning ownership to the root user, for instance, restricts access to users with administrative privileges, protecting sensitive files from unauthorized modifications. However, it requires careful management to avoid accidentally restricting legitimate access .

A soft link, or symbolic link, is a pointer or shortcut to a file or directory, whereas a hard link is a direct reference to the file's inode, making it indistinguishable from the original file. Soft links can span across different filesystems, whereas hard links cannot. When the original file is deleted, a soft link becomes a dangling pointer, whereas a hard link keeps the actual file intact because the inode still exists as long as at least one hard link remains .

An alias in the Linux command line is used to simplify long command sequences by creating a shortcut name for the command. This improves workflow efficiency by reducing the keystrokes needed to execute frequently used commands. For instance, creating an alias for 'his10' to show the last 10 used commands saves time and minimizes errors in typing long command sequences .

Permission changes using the symbolic method involve setting or modifying permissions using characters like '+', '-', '=', while the octal method uses numeric codes. Both methods are critical in Linux security management, but each offers different flexibility levels. The symbolic method allows intuitive and granular control over specific permissions, whereas the octal method provides a compact, numerical representation suitable for scripts and programming contexts. Mismanagement can either overly restrict access or unintentionally expose sensitive files .

You might also like