Unix Programming Lab Assignment - Unix Commands: TH TH
Unix Programming Lab Assignment - Unix Commands: TH TH
18. Output of who should be sorted and displayed on the screen along with the total number
of users. The same output except the number of users should also be stored in a file file1.
19. Merge the contents of the file a.txt, b.txt and c.txt , sort them and display the sorted
output on the screen page by page
20. Display the list of last 20 files present in the current directory. Also store this list in file
profile.
21. Extract the address field from a file text.
22. Search all the lines in a file which begin with a, b or c.
23. Search all the lines in a file which end with s to z.
24. There are 5 files available. How would you replace all occurrences of the
word printf in these files with the word PRINTF.
25. In the middle of the file being typed you want to import the output of who command.
How would you do this?
26. While editing a file file1 you want to read of the line numbers 10 to 20 from file2
can you do this?
27. Let us assume that a file by the name of sample is having the permission of rwxr_ _r _x,
now change the permission of this file to r_ _ _w_ _w_ by using symbolic mode.
28. Write a program using bc to print squares of numbers from 1 to 20.
29. Divide any file which consists of 20 lines into subfiles where each subfile contains 5
lines.
30. Join any two files vertically by placing the : as the separator between them.