Unix interview questions part 42

Unix interview questions part 42

Take as many assements as you can to improve your validate your skill rating

Total Questions: 20

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?

Correct Answer is : uniq

9. uniq command requires a sorted file as input.

Correct Answer is : TRUE

10. Which option is used with uniq command for selecting non-repeated lines?

Correct Answer is : -u

11. Which option is used for selecting repeated entries?

Correct Answer is : -d

12. ______ option is used for counting frequency of occurrence.

Correct Answer is : -c

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?

Correct Answer is : tr

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.

Correct Answer is : TRUE

17. Which option is used with tr command for deleting characters?

Correct Answer is : -d

18. ______ option is used for compressing multiple consecutive characters.

Correct Answer is : -s

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

Similar Interview Questions

    Search for latest jobs

    Icon
    Icon