You are on page 1of 4

UNIX Hands-on Document

Version 1.1

Page 1 of 4

This document contains exercises on Unix & Shell Scripting aligned to e-learning courses.

UNIX Essentials Module 1

Page 3

UNIX Operating System UNIX Commands Files and Directories INIX Utilities
Page 4

UNIX Essentials Module 2

Process Management Shell Programming

Page 2 of 4

UNIX Essentials Module 1 UNIX Operating System UNIX Commands Files and Directories INIX Utilities

1. Get the names of files, directories and subdirectories in the root directory into the file named filesunder-root. The file should not contain any error messages associated with directories that could not be opened. 2. Assuming the file abc exists and has some content, what would happen when the following command is executed? $ cat abc > abc 3. Compress files in the current directory, and then uncompress the files. 4. Create a tar file for all the files whose name begin with any of the characters a to k (both inclusive) 5. Use touch command to create files a, b and c. Copy them into the directory newdir. 6. Create an empty file test123 using touch command and remove write permission to group and others. 7. Create directory named newdir and change permissions such that read, write & execute permissions are given only to the owner. 8. List files whose file name is exactly 5 characters, from the current directory. 9. Print the name of the largest file in the current working directory. 10. Sort /etc/passwd file on the basis of login shell.

Page 3 of 4

UNIX Essentials Module 2 Process Management Shell Programming

1. Write a shell program to find the greatest among three numbers. 2. Write a shell program to find the factorial of a given number. 3. Write a menu driven shell program to convert Celsius to Fahrenheit and vice versa. [HINT : (9/5)*c+32] 4. Write a shell program to open an existing file and count the number of lines written in the file.

Page 4 of 4

You might also like