Anda di halaman 1dari 3

I. Create a folder LP_ES_SECTION deptno Eg : LP_ES_A501.

Save the Output as


notepad file

1. Create a directory unixpracs under the user’s HOME directory (2)


2. Delete the directory you created (2)
3. List the attributes of directories only. (2)
4. Given the following file, perform the following operations using it.

category~brand~qty~price
soap~hamam~234~12
soap~dettol~105~22
soap~lux~120~35
noodles~magi small~50~3
noodles~magi big~152~25
noodles~top ramen~300~5
shampoo~fiama~10~100
shampoo~lux~7~120
a. Store details of soap in a file called soap file (3)
b. Display brand and price of all products in shampoo category (4)
c. Arrange details of the file on price in reverse order (2)
5. Write a menu driven program to perform basic arithmetic operation. (20)
6. Count the number of user’s logged in. if more than 20 users are logged in, display a
Message. (15)

II. Create a folder LP_ES_SECTION deptno Eg : LP_ES_A501. Save the Output as


notepad file

1. You have just logged in. Enter the command to display the current working directory. (2)
2. Create the file with some contents. List the permission of the same file. Delete the file
you created. (3)
3. Display files in a certain directory that has been modified in January (1)
4. Given the following file ,perform the following operations using it
Eid |EmpName|Addr |Dept |grade|DOB|Salary
3005|Priya |24K, Raj Road,Bombay |RND |E1 |06-11-60 |1600
3010|Preethi |10, Besant Road Chennai |Accts |E2 |21-12-70 |2000
3030|Aarthi |12, Lake View Road Bombay |MKT |S1 |1-12-60 |1500
3023|Sanjana |Jaishankar|14, Adyar, Chennai |Accts |M1|12-12-85 |2200
a. List all the details of employee not in Accts department. (3)
b. Store the employee name, salary in a file and also display it on the terminal. (3)
c. Give the command that would print out the records of all employees whose
employee code is between 3010 and 3059. (3)
5. Write a shell script to display the following menu.
String operations
i. length of string
ii. convert string to upper case
iii. convert string to lower case
String is accepted as command line argument. (20)
6. Write a shell script that determines the period for which specified user is working on the system. (15)

III. Create a folder LP_ES_SECTION deptno Eg : LP_ES_A501. Save the Output as


notepad file

1. Create directories called map1, map2. Copy a file from map1 and paste it to map2 with a
new name. (3)
2. Change the permission of directory map2 for the group to read and write only. (3)
3. Display the inode number of files in the current directory (2)
4. Given the following file. Perform the following operations using it.
category~brand~qty~price
watch~titan~122~1224
watch~rolex~9~5908
watch~hmt~189~433
clock~ajanta~23~12
clock~citizen~122~22
a. Give the command to display records for the category watch along with record
number. (3)
b. Display the length of the first 3 records. (3)
c. Sort the file on price and store on it into filename sort price (3)
d. Display the category store it as file and then the price, store it as a file (3)
5. Write a menu driven shell script for
1. Printing the multiplication table (upto 12) of a number accepted from the command
line. (20)

2. Display good afternoon, good evening or good night depending upon time of day (10)

IV. Create a folder LP_ES_SECTION deptno Eg : LP_ES_A501. Save the Output as


notepad file
1. Create a file and rename the file. (2)
2. Change the file access permission for all text file. Assign read permission for all users
and remove execute permission. (3)
3. The student file contains the following data
name~subject~marks
smith~math~80 ann~science~75 john~math~95
ann~math~78 smith~science~35 mary~english~76
mary~science~45 nancy~english~92 nancy~math~94
a. Display the number of records in the student file (3)
b. List all the details for all students other than mary (3)
c. Display the subject and name sorted by marks (4)
4. Write a shell script to display a menu (15)
a. To display the details of the user currently logged in.
b. Date and time
c. Contents of the current directory
d. Display the contents of file1.txt and file2.txt.
e. Exit
5. Calculate the salary of an employee whose Name, EmpNo and basic pay is given by the
user as command line argument. Calculate the netpay given,
HRA=30% of basic pay DA= 95% of basic pay PF= 12% of basic pay
Netpay=basic pay+HRA+DA-PF
(20)

Anda mungkin juga menyukai