1. close system call returns ____
Correct Answer is : 0 and -1
2. ____ system call is used for writing to a file.
Correct Answer is : write
3. write system call returns -1 when ___________
Correct Answer is : if disk fills up while write is in progress and if the file size exceeds
4. ____ system call is used for positioning the offset pointer.
Correct Answer is : lseek
5. Which of the following offset is used with lseek system call to set the offset pointer to the end of the file?
Correct Answer is : SEEK_END
6. Which of the following system call is used for truncating a file?
Correct Answer is : truncate and ftruncate
7. truncate needs the ___ of the file as an argument but ftruncate works with _______
Correct Answer is : pathname, file descriptor
8. Which command is used for locating repeated and non-repeated lines?
9. uniq command requires a sorted file as input.
10. Which option is used with uniq command for selecting non-repeated lines?
11. Which option is used for selecting repeated entries?
12. ______ option is used for counting frequency of occurrence.
13. The output of the following command will be:
$ uniq foo1 foo2
Correct Answer is : process foo1 and output is stored in foo2
14. Which command is used for translating characters?
15. To replace | with ~, which one of the following commands will be used?
Correct Answer is : tr ‘|\’ ‘~-‘ > emp.lst
16.
head -n 3 emp.lst | tr ‘[a-z]’ ‘[A-Z]’
Above command will change the case of text from lower to upper.
17. Which option is used with tr command for deleting characters?
18. ______ option is used for compressing multiple consecutive characters.
19. test command can be used to check which of the following?
Correct Answer is : All of the mentioned
20. test command can be used to check which of the following?
Correct Answer is : All of the mentioned