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

Lab1_Basic-Commands (1)

This document outlines a lab for Operating System Administration focusing on basic UNIX commands and file management tasks. It includes objectives, required work, and specific exercises related to directory creation, file handling, and understanding command-line operations. Additionally, it covers concepts like hard links and soft links, along with practical tasks to reinforce learning in a UNIX environment.

Uploaded by

nadia
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)
9 views

Lab1_Basic-Commands (1)

This document outlines a lab for Operating System Administration focusing on basic UNIX commands and file management tasks. It includes objectives, required work, and specific exercises related to directory creation, file handling, and understanding command-line operations. Additionally, it covers concepts like hard links and soft links, along with practical tasks to reinforce learning in a UNIX environment.

Uploaded by

nadia
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 : Basic Commands


Class : 3B1
Teacher: Marwa Chamekh
AY : 2022-2023

Objectives :

The Purpose of this Lab is to:


✔ Remember the basic SHELL commands
✔ Understand the necessary control points in the administration and security of
Unix operating systems.

Required Work :

A. Basic commands

Remember:
mkdir repx: create repx directory
cd repx: go to repx directory
ls repx: list the contents of the repx directory
cp file1 dest: copy the file file1 to dest
cp -r repx repy: make a copy of the repx directory called repy
mv fich3 fich4: rename the file fich3 to fich4

1. What is the difference between Unix and Linux?


2. Open the Terminal and display the contents of the environment variables: PATH and SHELL.
Explain
3. Type the command pwd. Explain the displayed result
4. How do you get back to your home directory regardless of where you are sitting in the file
system.

1
Operating System Administration : UNIX

Note: Each question must be answered with a single command line and the current
directory must always be your home directory
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»

B. man pages
Open a 2nd terminal and display the man page of ls. Find in the manual pages the option or
options that are appropriate for the following exercises.

1. Display the contents of session1 and Python/ Lab2. Your remarks?


2. List the contents of ~ with full details.
3. Go to Python/Lab1. Make sure you are there, and then, in a single command, move to
Unix/Lab2 using a relative path.
4. Return to Python/Lab1, but this time using the absolute path. Finally, return to the root of your
home directory.
5. Delete the Lab1 directory from Python.
6. Remove the Lab2 directory from Python with the rmdir command, why did the command fail?
Remove Lab2 from Python.
7. Move ex1 into Lab1 and delete session1 and session2.
8. Rename ex1 to exercise1.

C. Handling files and directories


1. Create a directory under /home/your_fname named "Practical"
2. Create another directory under /home/your_name named photos that contains 3 files named:
tunis.jpg, bizerte.jpg, and hammamet.jpg
3. Create under Practical a file OS.txt
4. Edit the file OS.txt, copy the paragraph below, save and exit:

Message from Linus Torvalds to comp.os.minix (August 1991) announcing his project:
Hello everybody out there using minix -
I’m doing a (free) operating system (just a hobby, won’t be big and professional like gnu) for
386(486) AT clones. This has been brewing since April, and is starting to get ready. I’d like any
feedback on things people like/dislike in minix, as my OS resembles it somewhat (same
physical layout of the file-system (due to practical reasons) among other things).

2
I've currently ported bash(1.08) and gcc(1.40), and things seem to work. This implies that I'll
get something practical within a few months, and I'd like to know what features most people
would want. Any suggestions are welcome, but I won't promise I'll implement them :-)
Linus ([email protected])
PS. Yes - it's free of any minix code, and it has a multi-threaded fs. It is NOT portable (uses
386task switching etc), and it probably never will support anything other than AT-harddisks,
as that's all I have:-(.
Linus Torvalds
5. Display the contents of your file OS.txt on the terminal.
6. Display only the first 3 lines of the file OS.txt on the terminal.
7. Display only the last 3 lines of the file OS.txt on the terminal.
8. Create a second directory under /home/your_name called Doc
9. Move the file OS.txt to Doc and rename it SE.txt
10. Delete the directory Practical with confirmation request before permanent deletion.

D. Hard Link & Soft Link


1. Define an inode
2. Create a hard link between the file SE.txt and a new file named hard_link
3. Verify that the two files have the same inode number
4. Create a soft link between the file SE.txt and a new file named soft_link
5. Verify that this is a soft link

You might also like