Sie sind auf Seite 1von 3

1) Create below two files content in your current working and directory.

File_1:
Steward 5000
Chef 7500
Manager 12500
DeliveryBoy 6500
HR 10000
Admin 8000
File_2:
Tony Chef
Jim Steward
Sanjay DeliveryBoy
Nethu Manager
Ramesh Chef
Rajani Steward
Arthi Steward
Chitra HR
Sapna Admin
Kavya HR

a) Display the first 4 lines of the above file_1 and file_2


b) Display the last 5 lines of the above file_1
c) Display the first 50 characters for both the file
d) Print the 5th and 6th line of file_2 (Use head and tail filter)

2) Create below files content in your current working and directory.

Juliet's parents told her she must marry Paris. Her parents do not know she is
already married. She refuses in the beginning, but later agrees because she plans to
fake her death and escape to be with Romeo forever; again with the help of Friar
Laurence. (Please add more content to the file)
a )Display the content of a given file page wise.
b) Display the content of a given file in upper case.
c) Replace the character TCJSDNMRAKH to abcdefghijk
3) Create the below file in your current working directory.
1:Aishu:30:5000
2:Gayu:28:1000
3:Aarya:50:50000
4:Bhanu:20:10000
a) Sort the above file based on the age column.
b) Sort the above file in the decreasing order of the salary
c) Sort the file in ascending order of name

4) Create the below file in your current working and directory.


Good Morning
Have a nice day
Have a nice day
have a Nice Day
Good Bye
Good Bye
a) Sort the above file and provide the uniq content in the file.
b) Display the count of uniq lines
c) Display the uniq lines by skipping the first column.

5) Create the below file in your current working and directory.


Arthi 22 55
Rahul 20 65
Veena 21 45
Rohit 25 78
Kavya 22 55

a) Write the commands to find the sum of ages of all members


b) Write the commands to find the average weight of the members.
c) Write the commands to sort the names according to the weight of
members

6) Create the below file named in your current working and directory.
Good morning TVM57

You are doing your Unix Module


After this Module will start with Oracle Module

End of the Module details


a) Write a command to delete the empty lines of the above file
b) Write a command to find the count of pattern 'Module' in the above
file
c) Write a command to find occurance of the pattern 'Module' for the
above file
d) Write a command to replace the pattern 'Module' to 'Content' for the
above file

7) Use AWK to locate lines longer than 50 and smaller than 100 characters.

Das könnte Ihnen auch gefallen