Unix Assignments Xplore
Unix Assignments Xplore
HomeDir/Parent1/Child
HomeDir/Parent2/Child
5. -Write a command to Give rwr permission to Owner and give only the read permission to
others and take off the write permission to Group ?
6. -Search for a regular pattern(WITH 3 CHARACTERS -First character is 'A' and Last
Character is 'E' in a file/Files
7. -Search for a regular pattern(WITH 3 CHARACTERS -First character is 'A' and Last
Character is 'E' but
8. Second character is not EITHER OF B,C,D) in a file/Files
9. -Search in a file(S) for lines line starting with the an experssion,ending with an expression.
10. -Create a file with three columns seperated by Tab AND FETCH ONLY FIRST AND Third
columns values.
11. -Create a file with three columns seperated by any special any character .Fetch only first and
third columns values.
12. Create a file with three columns seperated by single space AND FETCH ONLY FIRST
AND Third columns values.
13. Creat a file in VI editor enter into Insert mode enter text of 10 lines with multiple words.
Append a word at the end of a current line.
Replace the line or word from current position.
14. Sort any given file on a given column number – Create a file with two to three columns of
values .Seperate the columns by any special character.
15. Display all the files containing TCS in the current file system
16. Find all the CPP files which are not being touched in the last 72 hours and change their
permission as below
-All Permissions to Owner
-Read and Execute permissions to Owner's Group
-Only Execute permissions to the Others – Not Owner's Group
17. Display all the .gch files which are not touched in the last year and remove them
18. Write the commands for the below scenarios,
a. Search for a given Pattern as content in multiple files, wrt 'case
insensitive search'
b. Search for the lines which start with Pattern/expression “begin” .
20. Display contents of a file(First and Fifth column from OUTPUT OF 'WHO'
Command) in a sort order?
21. Display contens of a file(First and Fifth column from OUTPUT OF 'WHO' Command)
in a sort order of second column in the file?
22. Assume a file with three columns,need to bring the third column to first column and
display the contents
23. Try using Cut and Awk commands on below problem statement
Expected output
*************************************************
Services Tata Consultancy
Limited Tata Motors
**************************************************
Expected output
*************************************************
Services Tata Consultancy
Limited Tata Motors
*************************************************
Observe the difference between cut and awk
25. Print the LineNumper for the entered "input line of text" .
26. Display the lines which are having oddnumber of fields in teh input
*******************************************************************
sample input file
*******************************************************************
Tata Consultancy Services India
TataSteel
Expected Output
*******************************************************************
Tata Motors Limited
TataSteel
*******************************************************************
27. If the Subject 4 marks are greated than >75 then display the record
********************************************************************
Sample Input file :
Sub1Mark Sub2Mark Sub3Mark Sub4Mark SudentName
*******************************************************************
70 80 50 80 Rajesh
80 80 80 90 Siddharth
*******************************************************************
29 .Find all the files in the current file system and grant the permission of read and Execute
for others and all permissions for the User .Implement using exec and xargs.
31. Write a script which will have multiple .cpp files contains a word : “TCS”
Replace the TCS with TataConsultanceServices at all occurance of all files in teh directory?
32.Write a script to read a file or folder from a user and provide full permissions?