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.
| 51. |
Which command is used for comparing two files?(a) cmp(b) comp(c) diff(d) commThe question was asked in an online interview.I want to ask this question from Comparing Files:comm, cmp and diff Command in section Handling Ordinary Files of Unix |
|
Answer» The correct option is (a) cmp |
|
| 52. |
Which option is used for backing up destination file in mv command?(a) -b(b) -f(c) -v(d) -iI had been asked this question during an online exam.I would like to ask this question from Deleting and Renaming files: rm and mv Command topic in portion Handling Ordinary Files of Unix |
|
Answer» The correct choice is (a) -b |
|
| 53. |
The inode number associated with a file is changed after renaming it.(a) True(b) FalseThe question was posed to me in unit test.This intriguing question comes from Deleting and Renaming files: rm and mv Command in section Handling Ordinary Files of Unix |
|
Answer» Right option is (b) False |
|
| 54. |
Which command is used for renaming files?(a) rename(b) mv(c) cp(d) moveI had been asked this question in a national level competition.The above asked question is from Deleting and Renaming files: rm and mv Command in portion Handling Ordinary Files of Unix |
|
Answer» The CORRECT CHOICE is (B) mv |
|
| 55. |
Apart from renaming files, mv command can also(a) move a file(b) move a group of files(c) rename a directory(d) move a group of filesand rename a directoryThis question was addressed to me during an internship interview.The above asked question is from Deleting and Renaming files: rm and mv Command topic in division Handling Ordinary Files of Unix |
|
Answer» The CORRECT answer is (d) move a group of filesand rename a directory |
|
| 56. |
What if the destination file specified in mv command already exists?(a) it will be deleted(b) it will not be affected(c) it will be overwritten(d) an error will be producedThe question was posed to me in class test.This intriguing question comes from Deleting and Renaming files: rm and mv Command in chapter Handling Ordinary Files of Unix |
|
Answer» The correct option is (c) it will be overwritten |
|
| 57. |
If the destination file does not exists, then mv command creates it.(a) True(b) FalseI have been asked this question at a job interview.My enquiry is from Deleting and Renaming files: rm and mv Command topic in portion Handling Ordinary Files of Unix |
|
Answer» Right answer is (a) True |
|
| 58. |
Which command is used for removing file named-file.txt?(a) rm -file.txt(b) rm file.txtrm(c) rm — -file.txt(d) rm -f file.txtI had been asked this question in an interview.I need to ask this question from Deleting and Renaming files: rm and mv Command topic in portion Handling Ordinary Files of Unix |
|
Answer» Correct ANSWER is (C) rm — -file.txt |
|
| 59. |
If we wish to delete a remove a file forcefully, we can use ____ option with rm command.(a) -i(b) -r(c) -R(d) -fThis question was posed to me in a job interview.My enquiry is from Deleting and Renaming files: rm and mv Command topic in chapter Handling Ordinary Files of Unix |
|
Answer» The CORRECT option is (d) -F |
|
| 60. |
Which one of the following command can delete a directory which is not empty?(a) rm-r(b) rmdir(c) rm *(d) del *This question was addressed to me in final exam.My doubt is from Deleting and Renaming files: rm and mv Command topic in section Handling Ordinary Files of Unix |
|
Answer» Correct answer is (a) RM-r |
|
| 61. |
Which option performs recursive deletion?(a) -r(b) -R(c) *(d) -r and -RThe question was asked during an interview.Origin of the question is Deleting and Renaming files: rm and mv Command topic in chapter Handling Ordinary Files of Unix |
|
Answer» Correct answer is (d) -R and -R |
|
| 62. |
Which option is used with rm command for interactive deletion?(a) -i(b) -f(c) -r(d) -RThis question was addressed to me by my college professor while I was bunking the class.My question is taken from Deleting and Renaming files: rm and mv Command in portion Handling Ordinary Files of Unix |
|
Answer» The CORRECT choice is (a) -i |
|
| 63. |
Some files cannot be deleted using rm command because of the permissions associated with it.(a) True(b) FalseI got this question in exam.Asked question is from Deleting and Renaming files: rm and mv Command topic in section Handling Ordinary Files of Unix |
|
Answer» The correct answer is (a) True |
|
| 64. |
-v option is used with cp command for displaying _____(a) errors(b) informative messages(c) diagnostic messages(d) file contentsI have been asked this question by my school principal while I was bunking the class.This interesting question is from Copying a File: cp Command in division Handling Ordinary Files of Unix |
|
Answer» Correct option is (B) INFORMATIVE messages |
|
| 65. |
To delete all files in a directory we use ______________(a) rmdir *(b) mv *(c) rm *(d) del *This question was addressed to me in class test.The query is from Deleting and Renaming files: rm and mv Command in chapter Handling Ordinary Files of Unix |
|
Answer» Correct choice is (c) rm * |
|
| 66. |
We can delete multiple files using a single rm command.(a) True(b) FalseThis question was posed to me during an interview.My question is taken from Deleting and Renaming files: rm and mv Command in section Handling Ordinary Files of Unix |
|
Answer» Correct option is (a) True |
|
| 67. |
Which command is used for removing/deleting files in UNIX?(a) rmdir(b) rm(c) del(d) mvThe question was asked during a job interview.This intriguing question originated from Deleting and Renaming files: rm and mv Command topic in chapter Handling Ordinary Files of Unix |
|
Answer» Correct option is (b) rm |
|
| 68. |
$ cp-fcopies forcefully.(a) True(b) FalseThe question was posed to me during an interview.My question is based upon Copying a File: cp Command topic in division Handling Ordinary Files of Unix |
|
Answer» The correct CHOICE is (a) True |
|
| 69. |
Which option is used with cp command for linking files instead of copying?(a) -v(b) -l(c) -f(d) -xI had been asked this question in an internship interview.My question is taken from Copying a File: cp Command topic in division Handling Ordinary Files of Unix |
|
Answer» The correct option is (b) -l |
|
| 70. |
-n option is used with cp command for what purpose?(a) existing file should not be overwritten(b) to update file(c) interactive copying(d) recursive copyingThis question was posed to me in exam.My enquiry is from Copying a File: cp Command topic in section Handling Ordinary Files of Unix |
|
Answer» Correct OPTION is (a) existing file should not be overwritten |
|
| 71. |
To copy multiple files, the last destination file should be a directory.(a) False(b) TrueThis question was posed to me in an interview for internship.This interesting question is from Copying a File: cp Command in chapter Handling Ordinary Files of Unix |
|
Answer» Right answer is (b) True |
|
| 72. |
What does -i option do?(a) interactive copying(b) recursively copying(c) updating(d) none of the mentionedI got this question in semester exam.My question comes from Copying a File: cp Command in chapter Handling Ordinary Files of Unix |
|
Answer» RIGHT option is (a) interactive copying The explanation is: (-i) option is used for interactive copying. It means that suppose if we invoke a command like cp file1file2 and if file2 already EXISTS then it will be overwritten which can be a nightmare for many USERS. To AVOID this, we use -i option. It provides us with a warning before OVERWRITING a file. It asks the user whether to overwrite the file or not. The syntax is cp-i source_filedest_file. |
|
| 73. |
Sometimes it is not possible to copy a file.(a) True(b) FalseThis question was posed to me in my homework.My query is from Copying a File: cp Command topic in chapter Handling Ordinary Files of Unix |
|
Answer» Correct option is (a) True |
|
| 74. |
How can we copy an entire directory under another directory?(a) using -R option(b) using -a option(c) using -u option(d) none of the mentionedThe question was posed to me by my school teacher while I was bunking the class.Asked question is from Copying a File: cp Command in section Handling Ordinary Files of Unix |
|
Answer» The CORRECT CHOICE is (a) using -R option |
|
| 75. |
How can we copy a file into our current directory?(a) cp file1(b) cp file1(c) cp file*(d) none of the mentionedI have been asked this question by my college professor while I was bunking the class.My doubt stems from Copying a File: cp Command topic in chapter Handling Ordinary Files of Unix |
|
Answer» Right option is (b) cp file1 |
|
| 76. |
What is the correct syntax for copying multiple files with a filename starting as ‘file’ into another file named as‘directory_one’?(a) cp -i filedirectory_one(b) cp -R filedirectory/directory_one(c) cp file*directory_one(d) none of the mentionedI have been asked this question in an internship interview.Origin of the question is Copying a File: cp Command topic in chapter Handling Ordinary Files of Unix |
|
Answer» The correct ANSWER is (c) cp FILE*directory_one |
|
| 77. |
Which of the following is not an option of cp command?(a) -z(b) -i(c) -R(d) -uThe question was asked in exam.Asked question is from Copying a File: cp Command in portion Handling Ordinary Files of Unix |
|
Answer» CORRECT choice is (a) -z For explanation: cp command has MANY options available, each of which performs a unique task. (-i)is used for interactive copying (i.e.) it warns the USER before overwriting the DESTINATION file.(-R) is used for copying the entire directory structure into another directory structure. (-u) copies only when the source file is newer than the destination file. |
|
| 78. |
What happens if the destination file specified in cp command does not exist?(a) file will not be copied(b) an error will be produced(c) destination file will be automatically created(d) none of the mentionedThis question was posed to me in quiz.This is a very interesting question from Copying a File: cp Command in chapter Handling Ordinary Files of Unix |
|
Answer» RIGHT choice is (c) destination FILE will be automatically created For explanation: If the destination file does not exist, then cp command will automatically create a file with the same NAME and then it copies the contents of the source file to the file which is created.If the destination file already EXISTS, then it will be overwritten with the contents of the source file. |
|
| 79. |
What is the function of cp command in UNIX?(a) list all the available files in the current directory(b) delete a given file(c) cp is a command used for copying files and directories(d) change the directoryI got this question in homework.My question is based upon Copying a File: cp Command topic in portion Handling Ordinary Files of Unix |
|
Answer» RIGHT option is (c) cp is a command used for COPYING files and directories Explanation: cp command is BASICALLY used for CREATING a copy of source file or a group of files. The syntax of the command requires at least two filenames to be SPECIFIED. If both the files specified are ordinary files, the first file will be copied to the second file. The syntax of cp command is cp source_filenamedestination_filename. The contents of the source file will be copied to the destination file in the same directory. |
|
| 80. |
Which option is used with touch command which forces the command not to create file, if it does not exists.(a) -h(b) -c(c) -t(d) -fI got this question by my college professor while I was bunking the class.The above asked question is from Displaying and Creating Files: cat Command in section Handling Ordinary Files of Unix |
|
Answer» Correct OPTION is (b) -c |
|
| 81. |
Which one of the following commands is incorrect?(a) catfile01(b) cat > file01(c) cat >> file1(d) cat-a file01The question was asked in final exam.This intriguing question originated from Displaying and Creating Files: cat Command topic in portion Handling Ordinary Files of Unix |
| Answer» | |
| 82. |
Which command is used to create empty files?(a) cp(b) cat(c) touch(d) createThe question was posed to me in unit test.My question is taken from Displaying and Creating Files: cat Command in section Handling Ordinary Files of Unix |
|
Answer» The correct choice is (d) create |
|
| 83. |
Which of the following cannot be performed by cat command?(a) displaying files(b) creating files(c) appending files(d) deleting filesThe question was asked by my school teacher while I was bunking the class.Question is from Displaying and Creating Files: cat Command in division Handling Ordinary Files of Unix |
|
Answer» Right option is (d) deleting files |
|
| 84. |
What does cat file01file01file01 display?(a) error(b) blank terminal(c) contents of file01 three times successively(d) contents of file01 single timeThis question was posed to me in final exam.Origin of the question is Displaying and Creating Files: cat Command topic in division Handling Ordinary Files of Unix |
|
Answer» Correct choice is (C) CONTENTS of file01 three times successively |
|
| 85. |
Which option is used with the cat command for displaying file with line numbers?(a) -n(b) -v(c) -a(d) -xI have been asked this question in homework.My doubt is from Displaying and Creating Files: cat Command in division Handling Ordinary Files of Unix |
|
Answer» Right choice is (a) -n |
|
| 86. |
Which symbol is used to append an existing file?(a) >(b) >(d) $I have been asked this question during an online exam.Query is from Displaying and Creating Files: cat Command in chapter Handling Ordinary Files of Unix |
|
Answer» Right ANSWER is (c) >> |
|
| 87. |
Which option is used with cat command for displaying non-printable characters?(a) -v(b) -n(c) -x(d) -aI had been asked this question in an online quiz.My doubt stems from Displaying and Creating Files: cat Command in portion Handling Ordinary Files of Unix |
|
Answer» Correct answer is (a) -v |
|
| 88. |
If we create a file using cat command with the same filename which already exists in the current directory then,(a) existing file is deleted(b) new file will be created separately(c) existing file will be overwritten(d) an error will be producedI had been asked this question in an online interview.This key question is from Displaying and Creating Files: cat Command in division Handling Ordinary Files of Unix |
|
Answer» Right choice is (c) EXISTING file will be overwritten |
|
| 89. |
Which symbol is used with cat command for creating files?(a) >(b) |
|
Answer» Right OPTION is (a) > |
|
| 90. |
Multiple arguments as filenames can be specified in cat command.(a) True(b) FalseThe question was posed to me in exam.Question is from Displaying and Creating Files: cat Command in portion Handling Ordinary Files of Unix |
|
Answer» Right OPTION is (a) True |
|
| 91. |
Which command is used for displaying contents of a file?(a) cp(b) rm(c) cat(d) mkdirI had been asked this question in my homework.Question is taken from Displaying and Creating Files: cat Command topic in portion Handling Ordinary Files of Unix |
|
Answer» The correct option is (c) cat |
|
| 92. |
Apart from displaying file contents, cat command is also used for _____ files.(a) displaying(b) deleting(c) copying(d) creatingThe question was posed to me in an interview for job.My enquiry is from Displaying and Creating Files: cat Command topic in section Handling Ordinary Files of Unix |
|
Answer» RIGHT CHOICE is (d) creating For explanation: cat command is one of the most well-known commands of the UNIX system. It is generally used to DISPLAY the contents of a file on the terminal but can also be used for creating files. SUPPOSE to create a file abd.txt, type the following command |
|