Unix Lab QUESTION SET
Unix Lab QUESTION SET
(Autonomous)
COIMBATORE-32.
AUTONOMOUS ARREAR PRACTICAL EXAMINATIONS-NOVEMBER 2016
1. Perform all the operations with the help of the below given diagram.
1. Create a directory and sub directory for the below given tree structure.
2. Write a command which is used to list all the files in your home directory by using ls command.
3. Write a command to change directory to the subdir1 subdirectory. List the directory to view its contents. Then
use the "*" wildcard to remove all of the files.
4. Write a command to get out of the subdir1 subdirectory by using the command cd .. Now try to use rm to
remove a directory.
5. To view the name of the current directory
6. To display all the files including hidden files
7. To display all the files with its inode number
8. To display all the files including files in subdirectories.
9. To create a directory called stud.change the stud.directory
10. To verify whether you have actually changed to the stud diectory,return to your original directory.
2. Perform all exercises:
1. Consider a file, employee.txt, with the following content :
2. Write a unix command to display only the date part and ignore the time part?
3. Write a unix command to display only the time part and ignore the date part?
4. The input file contains the below text
cat filenames.txt
logfile.dat
sum.pl
add_int.sh
5. First reverse the text in each line and then apply the command on it.
6. How to find out the difference two files.
7. Demonstration of cat command usage by considering the below text file as an example
Quote.txt :
Stars can't shine without darkness..
psychopathy is the only useful craziness.
See you on my next dream.....
8. Write a unix command to display contents of a file
9. Write a unix command to display the contents in numbering order.
10. Write a unix command to display "$" at end of each line
2. Perform all exercises:
A201 Ashwin 3500 Sales
A202 Barathi 4000 Production
A203 Chitra 4500 Manager
A204 Devi 5000 MD
1. Append a new record at the end of the file.
2. Substitute “Sales” as “Production”.
3. Print only the production employee details.
4. Display A102 as A102ID.
5. Display first 2 lines and quit.
6. Delete the line 4 from the file.
7. Insert a header in to the file.
8. Write the MD details to another file.
9. Display MD and Manager details alone.
3. Write a Shell Script to find whether number is positive,negative or zero
4. Mr.John was worked in a small company and earned less salary for a month. He was not
satisfied with his salary which meets only his daily living. One day he dreamed like building a new house with his
earning. He worked day and night, for his dream and finally he built a new house. He kept house warming function and
invited all his friends and family for this function added with chief guest as his school teacher. His teacher gifted a
written bless note for newly created home. All guests read the note and felt happy. Identify hidden system call and
implement c program using that system calls.
Assume that the Sugar level and blood groups are given for the patients.
1. Display only the A1+VE details
2. Print whose sugar count is greater than or equal to 150
3. Find the length of the all lines in the given file
4. Print the Total Patient count
5. Display the first occurrence of a character “c” in the string “stock”
6. Generate random numbers between 0-1
7. Print only the blood group name of “balu” items
3. Write script to print given numbers sum of all digit, For eg. If no is 123 it's sum of all digit
will be 1+2+3 = 6.Get input through command line arugument.
4. In a celebration party, guests are warmly invited with their own dress code. Mr.Alois Army
general of germany and his daughter Eva Braun are invited to that party and requested to be in
their traditional dress code. Guests came with their family members to felicitate the party. These celebrity were
welcomed by red carpet and Mr.Alois requested her daughter to present a memento to all celebrity. Identify the hidden
concept with necessary system call and explain using c program.
1. Write command to move content of file to another new file without options
Use options to satisfy the following constraints
2. Backup a file but does not accept an argument.
3. Move a file that do not prompt before overwriting
4. Move a file that prompt before overwriting
5. Move a file contents to new file do not overwrite an existing file
6. Remove file and ignore nonexistent files, never prompt
7. Remove file and prompt before every removal
8. Remove file and prompt once before removing more than three files, or when removing recursively.
9. Write a unix xargs command to echo the given text?
10. Write a unix xargs command to Specify Delimiter
2. Perform all exercises:
1. Create a file with the below contents