JOBSEEKERS
Login
Sign Up
Jobseeker
Employer
Staffing Firm
Direct Client
Unix interview questions part 42
Unix interview questions part 42
Back
Take as many assements as you can to improve your validate your skill rating
Total Questions: 20
1. close system call returns ____
A. 0
B. -1
C. 1
D. 0 and -1
Show Correct Answer
Correct Answer is :
0 and -1
2. ____ system call is used for writing to a file.
A. read
B. write
C. close
D. seek
Show Correct Answer
Correct Answer is :
write
3. write system call returns -1 when ___________
A. if disk fills up while write is in progress
B. when file doesn’t exist
C. if the file size exceeds the system’s limit
D. if disk fills up while write is in progress and if the file size exceeds
Show Correct Answer
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.
A. read
B. write
C. open
D. lseek
Show Correct Answer
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?
A. SEEK_SET
B. SEEK_END
C. SEEK_CUR
D. SEEK_CR
Show Correct Answer
Correct Answer is :
SEEK_END
6. Which of the following system call is used for truncating a file?
A. truncate
B. ftruncate
C. trunk
D. truncate and ftruncate
Show Correct Answer
Correct Answer is :
truncate and ftruncate
7. truncate needs the ___ of the file as an argument but ftruncate works with _______
A. pathname, file descriptor
B. file descriptor, pathname
C. pathname, pathname
D. file descriptor, file descriptor
Show Correct Answer
Correct Answer is :
pathname, file descriptor
8. Which command is used for locating repeated and non-repeated lines?
A. sort
B. uniq
C. cut
D. paste
Show Correct Answer
Correct Answer is :
uniq
9. uniq command requires a sorted file as input.
A. TRUE
B. FALSE
C.
D.
Show Correct Answer
Correct Answer is :
TRUE
10. Which option is used with uniq command for selecting non-repeated lines?
A. -i
B. -c
C. -u
D. -a
Show Correct Answer
Correct Answer is :
-u
11. Which option is used for selecting repeated entries?
A. -d
B. -c
C. -u
D. -a
Show Correct Answer
Correct Answer is :
-d
12. ______ option is used for counting frequency of occurrence.
A. -d
B. -c
C. -u
D. -a
Show Correct Answer
Correct Answer is :
-c
13. The output of the following command will be: $ uniq foo1 foo2
A. erroneous
B. output stored in foo2
C. concatenates both files
D. process foo1 and output is stored in foo2
Show Correct Answer
Correct Answer is :
process foo1 and output is stored in foo2
14. Which command is used for translating characters?
A. sort
B. trans
C. tr
D. paste
Show Correct Answer
Correct Answer is :
tr
15. To replace | with ~, which one of the following commands will be used?
A. tr ‘|\’ ‘~-‘
B. tr ‘|\’ ‘~-‘ > emp.lst
C. tr | ~ emp.lst
D. !
Show Correct Answer
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.
A. TRUE
B. FALSE
C.
D.
Show Correct Answer
Correct Answer is :
TRUE
17. Which option is used with tr command for deleting characters?
A. -d
B. -c
C. -n
D. -a
Show Correct Answer
Correct Answer is :
-d
18. ______ option is used for compressing multiple consecutive characters.
A. -d
B. -c
C. -n
D. -s
Show Correct Answer
Correct Answer is :
-s
19. test command can be used to check which of the following?
A. Compare two numbers
B. Compare two strings
C. Check attributes of a file
D. All of the mentioned
Show Correct Answer
Correct Answer is :
All of the mentioned
20. test command can be used to check which of the following?
A. Compare two numbers
B. Compare two strings
C. Check attributes of a file
D. All of the mentioned
Show Correct Answer
Correct Answer is :
All of the mentioned
Similar Interview Questions
Search for latest jobs
Find Jobs