JOBSEEKERS
Login
Sign Up
Jobseeker
Employer
Staffing Firm
Direct Client
Unix interview questions part 7
Unix interview questions part 7
Back
Take as many assements as you can to improve your validate your skill rating
Total Questions: 20
1. Which of the following commands can be used to replace ‘professor’ with ‘director’ throughout the whole file?
A. 1,$s/professor/director/g
B. %s/professor/director/g
C. 1,$s/professor/director
D. 1,$s/professor/director/g and %s/professor/director/g
Show Correct Answer
Correct Answer is :
1,$s/professor/director/g and %s/professor/director/g
2. Which of the following flag will be used for interactive substitution?
A. g
B. G
C. gc
D. cg
Show Correct Answer
Correct Answer is :
gc
3. Which one of the following commands will be used to delete all the instances of string ‘manager’ in file003?
A. 1,$s/manager/ /g
B. %s/manager/director/g
C. 1,$s/professor/director
D. %s/manager/ /
Show Correct Answer
Correct Answer is :
1,$s/manager/ /g
4. Which one of the following command is invalid?
A. /printf
B. ?scanf
C. :%/abd/mash/wc
D. :1,%/file01/file02/g
Show Correct Answer
Correct Answer is :
:1,%/file01/file02/g
5. Search and replace operations can also use regular expressions for matching multiple patterns.
A. TRUE
B. FALSE
C.
D.
Show Correct Answer
Correct Answer is :
TRUE
6. Which command is used for comparing two files?
A. cmp
B. comp
C. diff
D. comm
Show Correct Answer
Correct Answer is :
cmp
7. What is the exit status of cmp command if both the files are identical?
A. 0
B. 1
C. 2
D. undefined
Show Correct Answer
Correct Answer is :
0
8. Which option is used with cmp command to display a detailed list of mismatches?
A. -a
B. -b
C. -f
D. -l
Show Correct Answer
Correct Answer is :
-l
9. Which option is used with cmp command to limit the number of bytes to be compared?
A. -n
B. -l
C. -f
D. -b
Show Correct Answer
Correct Answer is :
-n
10. How can we skip some initial bytes from both the files to be compared?
A. using -b option
B. using -n option
C. using -l option
D. using -i option
Show Correct Answer
Correct Answer is :
using -i option
11. -b option is used with cmp command to print the differing bytes in both files.
A. TRUE
B. FALSE
C.
D.
Show Correct Answer
Correct Answer is :
TRUE
12. Which command compares two sorted files line by line?
A. cmp
B. diff
C. comm
D. sort
Show Correct Answer
Correct Answer is :
comm
13. What will be the command if we want to suppress column 1 and column 2 in the output of comm Command?
A. comm -12
B. comm -1-2
C. comm -3
D. comm -1,-2
Show Correct Answer
Correct Answer is :
comm -12
14. For comm command to work properly, files specified should be sorted.
A. TRUE
B. FALSE
C.
D.
Show Correct Answer
Correct Answer is :
TRUE
15. Which command is used to display the differences between files?
A. comm
B. diff
C. cmp
D. differ
Show Correct Answer
Correct Answer is :
diff
16. When two files are identical, what is the output of diff command?
A. Files are identical
B. Returns prompt
C. No output
D. Throws an error
Show Correct Answer
Correct Answer is :
Returns prompt
17. Which option is used to produce multi columnar output in diff command?
A. -y
B. -v
C. -s
D. -e
Show Correct Answer
Correct Answer is :
-y
18. If we are interested in knowing that whether the two files are identical or not, we can use ___ command.
A. comm
B. diff
C. cmp
D. differ
Show Correct Answer
Correct Answer is :
cmp
19. Which of the following is used to compress files?
A. cmp
B. gzip
C. gunzip
D. comm
Show Correct Answer
Correct Answer is :
gzip
20. Which one of the following extension is provided by gzip to the compressed filename?
A. .cm
B. .gz
C. .zip
D. .zp
Show Correct Answer
Correct Answer is :
.gz
Similar Interview Questions
Search for latest jobs
Find Jobs