InterviewSolution
This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.
| 1. |
zip and unzip can perform each and every function that is performed by gzip, gunzip and tar.(a) True(b) FalseThis question was posed to me in homework.This interesting question is from Compressing and Archiving Files in section Handling Ordinary Files of Unix |
|
Answer» Right choice is (a) True |
|
| 2. |
Which option is used with unzip command to view the contents of a compressed archive?(a) -v(b) -t(c) -c(d) -xI had been asked this question at a job interview.I want to ask this question from Compressing and Archiving Files topic in division Handling Ordinary Files of Unix |
|
Answer» The correct option is (a) -V |
|
| 3. |
If the uncompressed file already exists on disk, unzip asks for the user confirmation whether to replace the existing file or not.(a) True(b) FalseI got this question during an online interview.Query is from Compressing and Archiving Files topic in portion Handling Ordinary Files of Unix |
|
Answer» Correct CHOICE is (a) True |
|
| 4. |
Which command is used for unzipping files which are compressed using zip command?(a) gunzip(b) gzip(c) unzip(d) guzipI got this question in class test.My doubt is from Compressing and Archiving Files in section Handling Ordinary Files of Unix |
|
Answer» Right option is (c) unzip |
|
| 5. |
For recursive compression, zip uses -r option.(a) True(b) FalseThis question was addressed to me in examination.My query is from Compressing and Archiving Files in section Handling Ordinary Files of Unix |
|
Answer» Correct answer is (a) True |
|
| 6. |
For using zip command, the first argument should be a compressed filename.(a) True(b) FalseI had been asked this question in an interview.I need to ask this question from Compressing and Archiving Files topic in portion Handling Ordinary Files of Unix |
|
Answer» The correct option is (a) True |
|
| 7. |
Which command is used for compressing and archiving files together?(a) gzip and tar(b) gzip(c) bzip2(d) zipThis question was posed to me in semester exam.I need to ask this question from Compressing and Archiving Files in section Handling Ordinary Files of Unix |
|
Answer» The correct OPTION is (d) zip |
|
| 8. |
Which option is used by tar to append files to the end of an archive?(a) -t(b) -c(c) -x(d) -rI have been asked this question in exam.My doubt stems from Compressing and Archiving Files in division Handling Ordinary Files of Unix |
|
Answer» The correct OPTION is (d) -r |
|
| 9. |
To create an archive named abc.tar consisting of two files,file01 and file02, which of the following command will be used?(a) tar -cvfabc.tarfile01file02(b) tar -cvffile01file02abc.tar(c) tar -cvabc.tarfile01file02(d) tar -cabc.tarfile01file02This question was addressed to me in an internship interview.This key question is from Compressing and Archiving Files in chapter Handling Ordinary Files of Unix |
|
Answer» Correct choice is (b) TAR -cvffile01file02abc.tar |
|
| 10. |
Which command will be used for extracting files from an archive named abc.tar?(a) tar -xvfabc.tar(b) tar -cvfabc.tar(c) tar-tvfabc.tar(d) tar-tabc.tarThe question was asked in homework.Asked question is from Compressing and Archiving Files in chapter Handling Ordinary Files of Unix |
|
Answer» CORRECT choice is (a) tar -xvfabc.tar The best EXPLANATION: To EXTRACT files from an archive, we can use -x OPTION along with -v and -f. Above command will extract all the files which are present in the archive named abc.tar. |
|
| 11. |
Which of the following command is used for viewing the attributes of contents of an archive?(a) tar -tvfabc.tar(b) tar -cvfabc.tar(c) tar-xvfabc.tar(d) tar-tabc.tarI got this question in quiz.Origin of the question is Compressing and Archiving Files topic in section Handling Ordinary Files of Unix |
|
Answer» Correct answer is (a) tar -tvfabc.tar |
|
| 12. |
Which of the following key options is used with tar to create an archive?(a) -c(b) -x(c) -t(d) -farchive nameThe question was asked during an online exam.This interesting question is from Compressing and Archiving Files in portion Handling Ordinary Files of Unix |
|
Answer» RIGHT option is (a) -c To explain: The TAR PROGRAM USES these specified key options where each key option performs a specific function. |
|
| 13. |
Which of the following is an archival program?(a) arch(b) archive(c) ar(d) tarThis question was posed to me in an interview.I need to ask this question from Compressing and Archiving Files in chapter Handling Ordinary Files of Unix |
|
Answer» Right option is (d) tar |
|
| 14. |
We can provide multiple filenames as arguments to gunzip.(a) True(b) FalseI had been asked this question in exam.My question is from Compressing and Archiving Files in chapter Handling Ordinary Files of Unix |
|
Answer» Correct option is (a) True |
|
| 15. |
Which of the following is a better agent than gzip?(a) bzip2(b) bzip2 and bunzip2(c) bunzip2(d) allzipI got this question in my homework.I'd like to ask this question from Compressing and Archiving Files topic in chapter Handling Ordinary Files of Unix |
|
Answer» The correct option is (b) BZIP2 and bunzip2 |
|
| 16. |
We cannot uncompress files using gzip.(a) True(b) FalseThe question was posed to me in an online quiz.Query is from Compressing and Archiving Files topic in chapter Handling Ordinary Files of Unix |
|
Answer» The CORRECT OPTION is (b) False |
|
| 17. |
Which of the following is used for decompressing files?(a) GZIP(b) gunzip(c) uncmp(d) cmpThis question was addressed to me during an online interview.This question is from Compressing and Archiving Files topic in section Handling Ordinary Files of Unix |
|
Answer» RIGHT choice is (B) gunzip Easiest EXPLANATION: To restore our original and uncompressed file we can use gunzip with FILENAME as an ARGUMENT. |
|
| 18. |
Which option is used with gzip command for recursive compression?(a) -c(b) -l(c) -d(d) -rI had been asked this question in my homework.I'd like to ask this question from Compressing and Archiving Files in section Handling Ordinary Files of Unix |
|
Answer» Right answer is (d) -r |
|
| 19. |
We can provide original filenames without .gz extension while checking compression ratio using gzip– l?(a) True(b) FalseI had been asked this question in final exam.The query is from Compressing and Archiving Files topic in section Handling Ordinary Files of Unix |
|
Answer» CORRECT answer is (a) True The EXPLANATION is: Specifying the .gz extension is an optional FEATURE which may be neglected. The command will work properly even WITHOUT the extension. |
|
| 20. |
Which option is used with gzip command to check compression ratio for files?(a) -l(b) -c(c) -e(d) -xThis question was addressed to me by my college director while I was bunking the class.Asked question is from Compressing and Archiving Files in division Handling Ordinary Files of Unix |
|
Answer» CORRECT choice is (a) -l Explanation: Compression ratio is the ratio of, SIZE of the original file to the size of a compressed file. We can CHECK how much compression ratio is achieved using -l OPTION with GZIP. |
|
| 21. |
Which one of the following extension is provided by gzip to the compressed filename?(a) .cm(b) .gz(c) .zip(d) .zpThis question was addressed to me in an interview for job.This interesting question is from Compressing and Archiving Files in section Handling Ordinary Files of Unix |
|
Answer» Right option is (B) .gz |
|
| 22. |
Which of the following is used to compress files?(a) cmp(b) gzip(c) gunzip(d) commI had been asked this question by my school principal while I was bunking the class.This intriguing question comes from Compressing and Archiving Files in section Handling Ordinary Files of Unix |
|
Answer» The correct answer is (b) GZIP |
|
| 23. |
Which of the following is not an internal command for more?(a) q(b) f(c) b(d) zI got this question in an internship interview.My question is taken from Counting File Data: wc Command topic in chapter Handling Ordinary Files of Unix |
|
Answer» The correct option is (d) z |
|
| 24. |
file command identifies the file type by examining the magic number of the file.(a) True(b) FalseThe question was asked in examination.This intriguing question originated from Counting File Data: wc Command in section Handling Ordinary Files of Unix |
|
Answer» RIGHT option is (a) True The explanation: Magic number is the number which is embedded in the first few bytes of a FILE. EVERY file has a unique magic number which helps in IDENTIFYING the file TYPE. |
|
| 25. |
UNIX offers a pager named ____ which has replaced the original pager of UNIX called ____(a) more, less(b) less, more(c) more, pg(d) pg, moreThe question was posed to me in a national level competition.The doubt is from Counting File Data: wc Command in portion Handling Ordinary Files of Unix |
|
Answer» The correct choice is (C) more, pg |
|
| 26. |
-t option prints the title on the first page.(a) True(b) FalseThe question was posed to me in final exam.The doubt is from Counting File Data: wc Command in division Handling Ordinary Files of Unix |
|
Answer» Right option is (a) True |
|
| 27. |
Which command is used for knowing the file type?(a) file(b) type(c) filetype(d) type of fileThe question was asked in an internship interview.My question comes from Counting File Data: wc Command topic in portion Handling Ordinary Files of Unix |
|
Answer» The correct option is (a) file |
|
| 28. |
Which option is used for printing multiple copies of a file using lp command?(a) -l(b) -i(c) -t(d) -nI got this question in unit test.My question is taken from Counting File Data: wc Command in section Handling Ordinary Files of Unix |
|
Answer» Right option is (d) -n |
|
| 29. |
Which option is used with lp command if there are more than one printers in the system?(a) -t(b) -d(c) -i(d) -pThis question was posed to me in examination.The origin of the question is Counting File Data: wc Command topic in section Handling Ordinary Files of Unix |
|
Answer» Right CHOICE is (B) -d |
|
| 30. |
Which command is used for printing a file?(a) lp(b) pr(c) pg(d) moreI had been asked this question during an interview for a job.Enquiry is from Counting File Data: wc Command in portion Handling Ordinary Files of Unix |
|
Answer» CORRECT CHOICE is (a) lp Best explanation: lp command is USED for printing a single copy of the file SPECIFIED as an argument to lp command. For example, |
|
| 31. |
wc command can also work on a data stream.(a) True(b) FalseI got this question by my school teacher while I was bunking the class.This question is from Counting File Data: wc Command topic in section Handling Ordinary Files of Unix |
|
Answer» RIGHT choice is (a) True Easy explanation: wc COMMAND when invoked without any SPECIAL symbol ( like < or | ) or an argument it reads the INPUT from standard input. we have to provide the input from the keyboard and mark the end of input with Ctrl-D. For example, |
|
| 32. |
Which option is used for counting the number of characters in a file only.(a) -l(b) -W(c) -c(d) -wThis question was posed to me in an interview.My query is from Counting File Data: wc Command topic in section Handling Ordinary Files of Unix |
|
Answer» Correct OPTION is (c) -c |
|
| 33. |
Which option is used for counting the number of words in a file only?(a) -l(b) -W(c) -c(d) -wThis question was addressed to me during an interview.This interesting question is from Counting File Data: wc Command topic in chapter Handling Ordinary Files of Unix |
|
Answer» The correct OPTION is (d) -w |
|
| 34. |
Which command is used for counting words, lines and characters in a file?(a) diff(b) count(c) man(d) wcThis question was posed to me in an internship interview.My doubt stems from Counting File Data: wc Command in chapter Handling Ordinary Files of Unix |
|
Answer» Correct OPTION is (d) wc |
|
| 35. |
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) differI have been asked this question in unit test.I'd like to ask this question from Comparing Files:comm, cmp and diff Command topic in section Handling Ordinary Files of Unix |
|
Answer» The correct choice is (c) cmp |
|
| 36. |
wc command cannot take multiple filenames as arguments.(a) True(b) FalseThis question was addressed to me in semester exam.My doubt is from Counting File Data: wc Command in section Handling Ordinary Files of Unix |
|
Answer» The correct answer is (b) False |
|
| 37. |
Which option is used for counting the number of lines in a file only.(a) -l(b) -W(c) -c(d) -wThis question was addressed to me in semester exam.Question is from Counting File Data: wc Command in portion Handling Ordinary Files of Unix |
|
Answer» CORRECT option is (a) -l The best I can explain: -l option when used with wc COMMAND DISPLAY only the number of lines in the SPECIFIED FILE. |
|
| 38. |
Which option is used to produce multi columnar output in diff command?(a) -y(b) -v(c) -s(d) -eI had been asked this question by my college director while I was bunking the class.My question comes from Comparing Files:comm, cmp and diff Command topic in division Handling Ordinary Files of Unix |
|
Answer» RIGHT option is (a) -y Easiest explanation: -y option when used with DIFF COMMAND produces output in multiple COLUMNS. For example, |
|
| 39. |
For comm command to work properly, files specified should be sorted.(a) True(b) FalseI got this question during an online exam.Asked question is from Comparing Files:comm, cmp and diff Command topic in portion Handling Ordinary Files of Unix |
|
Answer» The correct answer is (a) True |
|
| 40. |
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 errorThe question was posed to me in an online interview.This question is from Comparing Files:comm, cmp and diff Command in portion Handling Ordinary Files of Unix |
|
Answer» The correct choice is (b) Returns PROMPT |
|
| 41. |
Which command is used to display the differences between files?(a) comm(b) diff(c) cmp(d) differThis question was addressed to me in class test.This question is from Comparing Files:comm, cmp and diff Command in chapter Handling Ordinary Files of Unix |
|
Answer» Correct option is (b) diff |
|
| 42. |
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,-2I had been asked this question in unit test.This question is from Comparing Files:comm, cmp and diff Command topic in section Handling Ordinary Files of Unix |
|
Answer» RIGHT answer is (a) comm-12 Easy explanation: comm command provides us with an OPTION for suppressing the columns in the output. For this task, we have to provide the column number as an option in the comm command. For EXAMPLE, -1 for column 1, -2 for column 2 and -3 for column 3. |
|
| 43. |
Which option is used with cmp command to limit the number of bytes to be compared?(a) -n(b) -l(c) -f(d) -bI have been asked this question during an online exam.The above asked question is from Comparing Files:comm, cmp and diff Command topic in section Handling Ordinary Files of Unix |
|
Answer» Correct option is (a) -n |
|
| 44. |
Which command compares two sorted files line by line?(a) cmp(b) diff(c) comm(d) sortThe question was posed to me in semester exam.The query is from Comparing Files:comm, cmp and diff Command topic in section Handling Ordinary Files of Unix |
|
Answer» Correct option is (c) comm |
|
| 45. |
-b option is used with cmp command to print the differing bytes in both files.(a) True(b) FalseThis question was addressed to me by my college director while I was bunking the class.My question comes from Comparing Files:comm, cmp and diff Command topic in portion Handling Ordinary Files of Unix |
|
Answer» RIGHT choice is (a) True The explanation is: -b option when used with cmp command print the byte number and the line number along with the differing BYTES, where the first MISMATCH OCCUR. For example, |
|
| 46. |
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 optionI have been asked this question during an online exam.Query is from Comparing Files:comm, cmp and diff Command topic in portion Handling Ordinary Files of Unix |
|
Answer» Right CHOICE is (d) using -i option |
|
| 47. |
Which option is used with cmp command to display a detailed list of mismatches?(a) -a(b) -b(c) -f(d) -lThe question was posed to me in an internship interview.This interesting question is from Comparing Files:comm, cmp and diff Command in section Handling Ordinary Files of Unix |
|
Answer» The correct answer is (d) -l |
|
| 48. |
Which option is used with mv command so that the destination file does not get overwritten?(a) -n(b) -f(c) -b(d) -iI got this question in final exam.Enquiry is from Deleting and Renaming files: rm and mv Command in division Handling Ordinary Files of Unix |
|
Answer» CORRECT option is (a) -n For explanation I WOULD say: If the destination file already EXISTS in mv command then it will be overwritten which can be harmful. To avoid this we use -n option with mv so that the destination file does not GET overwritten. -i option displays interactive messages and ASKS the user before overwriting the destination file. |
|
| 49. |
What is the exit status of cmp command if both the files are identical?(a) 0(b) 1(c) 2(d) undefinedI got this question in a national level competition.I'm obligated to ask this question of Comparing Files:comm, cmp and diff Command in division Handling Ordinary Files of Unix |
|
Answer» The CORRECT answer is (a) 0 |
|
| 50. |
-f option when used with mv command overwrites existing files without prompting any messages.(a) True(b) FalseThe question was asked during an online interview.I want to ask this question from Deleting and Renaming files: rm and mv Command topic in division Handling Ordinary Files of Unix |
|
Answer» The correct choice is (a) True |
|