0% found this document useful (0 votes)
2 views

Lab1.1-Introduction & Reminder

This document outlines a lab exercise for Unix operating system administration, focusing on basic Linux commands, file and directory management, permissions, hard and symbolic links, file searching, and text filtering. It includes step-by-step tasks for creating directories, modifying permissions, linking files, and processing text files. The lab aims to provide hands-on experience with essential Unix commands and file manipulation techniques.

Uploaded by

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

Lab1.1-Introduction & Reminder

This document outlines a lab exercise for Unix operating system administration, focusing on basic Linux commands, file and directory management, permissions, hard and symbolic links, file searching, and text filtering. It includes step-by-step tasks for creating directories, modifying permissions, linking files, and processing text files. The lab aims to provide hands-on experience with essential Unix commands and file manipulation techniques.

Uploaded by

mam838343
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Operating system Administration : Unix

Lab 1.1 – Introduction & Reminder


A. Basic Linux Commands: Files and Directories
1. What is the difference between Unix and Linux?
2. Open the Terminal and display the content of the environment variables: PATH and SHELL.
Explain.
3. Type the command pwd. Explain the displayed result
4. How do you return to your home directory regardless of your current location in the file system?

5. Let the above tree structure. From your home directory, we want to create this tree structure. To
do this:
a. Create two directories « Unix » and « Python » in your home directory.
b. Create two directories « Lab1 » et « Lab2 » in « Unix ».
c. Copy the directories « Lab1 » and « Lab2 » in « Python ».
d. Create two directories « Session1 » and « Session2 » in « Unix /Lab1».
e. Create two files « ex1 » and « ex2 » in the directory « Session1 ».
f. Copy the files « ex1 » and « ex2 » in « Python /Lab2 » with the new names «.ex1 » and «
.ex2 »
6. From the directory « Python/Lab1 », try to move to « Unix/Lab2 » using a relative path.
7. Get back to the directory « Python/Lab1 » using an absolute path.
8. Delete the directory « Lab1 » in « Python ».

1
9. Delete the directory « Lab2 » in « Python » using the command rmdir, did it work? Why?
Propose another command to delete the directory.
10. Move « ex1 » to « Lab1 » and delete « Session1 » and « Session2 ».
11. Rename « ex1 » to « exercice1 ».

B. Linux Permissions
1. Check the permissions configuration of the directory « Unix » and the file « exercice1 ».

2. Modify the permissions of the file « exercice1 » such that anyone can delete the file.

3. Deny the read permission to the directory « Lab1 » for everyone.


4. Restore the read permission and deny read permission to files in « Lab1 ».

C. Hard Links vs Symbolic Links


1. Display the inode number of the file « exercice1 ».
2. Create a hard link « hl_exe » to the file « exercice1 » in « Lab2 ».
3. Modify the content of the file « hl_exe ». What can be noticed for the file « exercice1 »?
Reciprocally, modify « exercice1 », check « hl_exe ». Conclude.
4. Create a symbolic link « sl_exe » to « exercice1 » in « Lab2 ».
5. Move the file « exercice1 » in « Unix ». Try to display the content of « hl_exe » et « sl_exe »
again. Delete the file « exercice1 ». What can we notice?

D. Search a File
1. Find in /etc all the file with the extension « .conf »
2. Find in /etc all the directories whose permissions rwx r-x r-x
3. Find in your home directory all the directories that are bigger than 3 Mbytes.

4. Find in /etc all the directories whose the name contains 3 characters and modified a week ago.

5. Delete all files in the home directory whose name starts with l or L.

2
E. Filter a text
1. Edit a new file exercice2 in « Unix » by inserting the following content:

2. Display the content of the file exercice2


3. Display the module names and teachers.
4. Display the modules whose name starts with S
5. Give the number of modules taught by Mr Mohamed
6. Display the 6th and 7th line of the file.
7. Sort module names alphabetically
8. Sort the file exercice1 by level in ascending order and display the result in a new file « Report »

9. Display the names of the 1st and 2nd year modules in the file « Report »

You might also like