You are on page 1of 1

1. Create empty files empty1, empty2 and empty3 by using a single command.

2. Create a file Myfile.txt and store your name, age and gender and address in it
by using cat command.

3. Create a file Friend.txt and store your friend name, age and gender and address
in it by using touch and one more appropriate commands.

4. Display the contents of the file Myfile.txt on the screen.

5. Copy the contents of the file Myfile.txt into another file newfile.txt.

6. Combines the contents of the file Myfile.txt and newfile.txt into another file
allfile.txt.

7. Delete newfile.txt.

8. Change the permissions for allfile.txt like user can read,write and execute,
group can read and write only and others can only read.

9. Rename the allfile.txt to combine.txt.

10. Merge and sort the contents of Myfile.txt and Friend.txt and display the sorted
output on the screen.

11. Count the number of lines and words in Myfile.txt and print the result to file
count.txt.

12. Print the first 3 lines of Myfile.txt to the screen.

13. Print line 3 to line 5 of Myfile.txt to the screen.

14. Display all lines in Myfile.txt which contain the word “Yangon”. Make sure the
searching is case insensitive.

15. Delete Myfile.txt and combine.txt at one command.

You might also like