Monday, January 11, 2010

OS Lab Exercise - 1

Objectives:

To make sure that students are comfortable with the basic steps involved in writing C codes and also understand the practical application of the LINUX/UNIX commands taught in the lectures.

Procedure and Tasks:

For first two hours:

1. Try out the basic LINUX/UNIX commands taught in the lectures. Experiment with the Vi editor. Try out things like saving a file, editing text or writing C code in Vi editor

2. Login as guest (password is guest123)

3. Open Terminal and find out the shell you are using.

4. Change your shell to sh

5. Write a shell script (using vi editor) to create a directory test in your area and copy the contents of /etc in test directory.

6. Move the contents of test directory in test1 directory

7. Copy the test1 directory in /tmp

8. Write, the date of Creation/Modification, ownership, group and permissions of test1 directory.

9. Find out the disk usage of /etc directory

10. Find out the disk free space of / partition

11. Create two users guest1 and guest2. guest1 should have his home directory in /users/guest1 and guest2 should have home directory in /home/guest2.

12. Set their passwords to guest123.

13. Use find command and locate command to find the location of passwd command

14. Find out the number of commands in /bin

15. Create a command to create new users (Use useradd command. See the man page of useradd for command options). Use chmod to give it appropriate permission so that only guest user can run this command

16. Find out the disk usage of /etc directory.

17. Find the hostname and domain name of the system.

18. Find the CPU and Memory utilization of the system.

19. Find the PID of the Process which is consuming maximum CPU

20. Use ssh and telnet to access your friends machine using guest1 and guest2 accounts

21. Delete the users guest1 and guest2 and remove their home directories.

22. Get familiar with a few more commands listed below and write one line each for their usage.

ssh

scp

netstat

ipconfig,ifconfig

whois

host

hostname

pwd

rm, mv

23. See man pages and try these commands

time

which

cat

find

grep

look

cd

ps

For Last One Hour:

· Write shell scripts in vi editor for various text and simple arithmetic operations.

· Design a basic calculator performing addition,subtraction,multiplication and division.