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. |
The output of ls dir* is ___(a) all files in the current directory(b) all files in the directory having a filename starting with dir(c) no filename is displayed(d) erroneousI had been asked this question in an internship interview.My question is from Listing Directory Contents: Is Command in chapter The File System of Unix |
|
Answer» Right option is (b) all FILES in the DIRECTORY having a filename starting with dir |
|
| 2. |
-t option sorts the files according to ____(a) last modification time(b) last access time(c) ASCII collating sequence(d) file sizeThe question was posed to me during an online exam.Origin of the question is Listing Directory Contents: Is Command topic in section The File System of Unix |
|
Answer» Correct option is (a) last modification time |
|
| 3. |
-u option sorts the files according to ____(a) last modification time(b) last access time(c) ASCII collating sequence(d) file sizeThis question was posed to me during an online exam.This question is from Listing Directory Contents: Is Command topic in chapter The File System of Unix |
|
Answer» The correct answer is (b) LAST access time |
|
| 4. |
ls -s prints the allocated file size in blocks.(a) True(b) FalseI got this question during an internship interview.My question comes from Listing Directory Contents: Is Command topic in chapter The File System of Unix |
|
Answer» Correct choice is (a) True |
|
| 5. |
What does the -S option do in ls command?(a) sorts according to modification time(b) sorts according to last access time(c) sorts according to file size(d) sorts according to inode numberI have been asked this question at a job interview.The doubt is from Listing Directory Contents: Is Command in chapter The File System of Unix |
|
Answer» The correct ANSWER is (c) sorts according to FILE size |
|
| 6. |
-r option is same as -R option in ls command.(a) True(b) FalseI have been asked this question by my school teacher while I was bunking the class.The question is from Listing Directory Contents: Is Command in portion The File System of Unix |
|
Answer» Correct option is (b) False |
|
| 7. |
What is the collating sequence of ls command for listing files?(a) Numerals>Uppercase> Lowercase(b) Numerals>Lowercase> Uppercase(c) Lowercase>Uppercase> Numerals(d) Uppercase> Numerals> LowercaseThis question was addressed to me in an online quiz.This interesting question is from Listing Directory Contents: Is Command in division The File System of Unix |
|
Answer» Right ANSWER is (a) Numerals>Uppercase> Lowercase |
|
| 8. |
How can we identify executables and directories from the output of ls command?(a) using -F option(b) using-x option(c) using -a option(d) using -i optionThis question was addressed to me in an online interview.This interesting question is from Listing Directory Contents: Is Command topic in division The File System of Unix |
|
Answer» The correct option is (a) USING -F option |
|
| 9. |
$ ls-R outputs all files and subdirectories in a recursive manner.(a) True(b) FalseThis question was posed to me during an interview.I would like to ask this question from Listing Directory Contents: Is Command in section The File System of Unix |
|
Answer» RIGHT option is (a) True The best explanation: The above command TRAVERSES the directory tree in a recursive manner until no subdirectories are left. In simple words, we can say that it PRODUCES a recursive listing of files. |
|
| 10. |
Which option is used with ls command to produce multi columnar output?(a) -x(b) -F(c) -a(d) -vI had been asked this question in examination.Question is taken from Listing Directory Contents: Is Command in division The File System of Unix |
|
Answer» Right CHOICE is (a) -x |
|
| 11. |
-a option is used with ls command for what purpose?(a) for showing hidden files(b) for showing executables(c) for showing directories(d) for multi columnar outputThis question was addressed to me by my college director while I was bunking the class.My question comes from Listing Directory Contents: Is Command in chapter The File System of Unix |
|
Answer» Right option is (a) for showing hidden files |
|
| 12. |
Which option is used with ls to display attributes of the directory ?(a) -a(b) -ld(c) -d(d) -oThis question was posed to me during an interview for a job.The question is from Listing Directory Contents: Is Command in portion The File System of Unix |
|
Answer» Correct option is (c) -d |
|
| 13. |
Which command is used for listing files in a directory?(a) ps(b) list(c) ls(d) wcI had been asked this question during an interview.My enquiry is from Listing Directory Contents: Is Command in division The File System of Unix |
|
Answer» The correct choice is (c) ls |
|
| 14. |
Which option is used with ls command for long listing of files with seven attributes?(a) -a(b) -l(c) -x(d) -iThe question was posed to me in final exam.This key question is from Listing Directory Contents: Is Command in portion The File System of Unix |
|
Answer» Right choice is (b) -l |
|
| 15. |
For moving two level up in the file hierarchy system using cd command once, we separates ( . . ) by which symbol?(a) ?(b) $(c) *(d) /This question was posed to me in an internship interview.This intriguing question originated from Absolute and Relative Pathnames topic in section The File System of Unix |
|
Answer» Correct OPTION is (d) / |
|
| 16. |
The output of$HOME is an example of absolute pathname.(a) True(b) FalseThe question was posed to me in a job interview.Asked question is from Absolute and Relative Pathnames topic in portion The File System of Unix |
|
Answer» Correct answer is (a) True |
|
| 17. |
cd/bin/user/directory/abc is an example of relative pathname.(a) True(b) FalseThis question was addressed to me in a job interview.This interesting question is from Absolute and Relative Pathnames topic in section The File System of Unix |
|
Answer» The CORRECT ANSWER is (b) False |
|
| 18. |
$ cd. .is used to move ___ level up in the file hierarchy.(a) two(b) one(c) three(d) zeroThe question was posed to me in an international level competition.My question comes from Absolute and Relative Pathnames in portion The File System of Unix |
|
Answer» Right choice is (b) ONE |
|
| 19. |
$ cp file_01.copies the file named file_01 in ____ directory(a) current(b) parent(c) root(d) userThe question was posed to me in an online interview.The doubt is from Absolute and Relative Pathnames in chapter The File System of Unix |
|
Answer» RIGHT option is (a) current Easiest explanation: The ( . ) represents the current DIRECTORY so the above command will create a copy of file_01 in the current WORKING directory. |
|
| 20. |
Which of the following cryptic symbols are used in relative pathname?(a) ( . )(b) ( . . )(c) $(d) ( . ) and ( . . )I got this question during an online exam.This key question is from Absolute and Relative Pathnames topic in section The File System of Unix |
|
Answer» The CORRECT choice is (d) ( . ) and ( . . ) |
|
| 21. |
What is a relative pathname?(a) pathname relative to parent directory(b) pathname relative to root (/)(c) pathname relative to parent and current directory(d) pathname relative to current directoryThe question was posed to me in an interview for internship.The question is from Absolute and Relative Pathnames topic in division The File System of Unix |
|
Answer» Correct choice is (C) PATHNAME RELATIVE to parent and current DIRECTORY |
|
| 22. |
What is an absolute pathname?(a) pathname relative to a parent directory(b) pathname relative to the root (/)(c) pathname relative to parent and current directory(d) pathname relative to the current directoryI got this question at a job interview.My query is from Absolute and Relative Pathnames topic in division The File System of Unix |
|
Answer» Correct option is (b) pathname relative to the root (/) |
|
| 23. |
Pathname is a sequence of symbols and directories indicating the location of a file.(a) True(b) FalseThis question was addressed to me by my school principal while I was bunking the class.My question is based upon Absolute and Relative Pathnames topic in portion The File System of Unix |
|
Answer» Right option is (a) True |
|
| 24. |
pwd and echo $HOME will display the same output.(a) True(b) FalseI got this question in an international level competition.This intriguing question comes from File Handling Commands: pwd, cd topic in chapter The File System of Unix |
|
Answer» Correct option is (b) False |
|
| 25. |
If rmdir dir001 fails, what could be the reason(s)?(a) dir001 doesn’t exist(b) dir001 is not empty(c) permissions of dir001 doesn’t allow to remove it(d) dir001 doesn’t exist, dir001 is not empty and permissions of dir001 doesn’t allow to remove itI had been asked this question at a job interview.I'd like to ask this question from File Handling Commands: pwd, cd in section The File System of Unix |
|
Answer» Right choice is (d) dir001 doesn’t exist, dir001 is not empty and permissions of dir001 doesn’t allow to REMOVE it |
|
| 26. |
For creating or removing directories, the user must be positioned above the directory or in the parent directory of the directory, on which the operation is to perform.(a) True(b) FalseI had been asked this question in an online interview.My doubt stems from File Handling Commands: pwd, cd topic in portion The File System of Unix |
|
Answer» The correct option is (a) True |
|
| 27. |
Multiple directories can be removed using single rmdir command.(a) True(b) FalseThis question was posed to me in final exam.This key question is from File Handling Commands: pwd, cd topic in section The File System of Unix |
|
Answer» Correct CHOICE is (a) True |
|
| 28. |
Which command is used for removing an empty directory?(a) mkdir(b) rmdir(c) del(d) removeThe question was asked during an online interview.This key question is from File Handling Commands: pwd, cd in division The File System of Unix |
|
Answer» The correct answer is (b) RMDIR |
|
| 29. |
Sometimes we are unable to create a directory because ______________(a) the directory may already exist in the current directory(b) there may be an ordinary file by the same name in the current directory(c) the permissions set for the current directory does not allow the creation(d) the directory may exist, there may be an ordinary file, the permissions set for the current directory does not allow the creationThis question was posed to me in unit test.I need to ask this question from File Handling Commands: pwd, cd topic in division The File System of Unix |
|
Answer» Right ANSWER is (d) the directory may exist, there may be an ordinary file, the permissions set for the CURRENT directory does not allow the creation |
|
| 30. |
We can create multiple directories by single invocation of mkdir command.(a) True(b) FalseThis question was posed to me in an interview.The question is from File Handling Commands: pwd, cd topic in portion The File System of Unix |
|
Answer» The correct option is (a) True |
|
| 31. |
cd command cannot be used without any argument.(a) True(b) FalseI had been asked this question in an online interview.The question is from File Handling Commands: pwd, cd in section The File System of Unix |
|
Answer» CORRECT choice is (b) False For EXPLANATION: cd command can be used without any arguments. When it used in such a way, then it CHANGES our current directory to HOME directory. |
|
| 32. |
Which command is used for creating directories?(a) rmdir(b) mkdir(c) cd(d) cpThe question was asked in semester exam.The doubt is from File Handling Commands: pwd, cd in chapter The File System of Unix |
|
Answer» Right choice is (B) mkdir |
|
| 33. |
Which command is used for printing the current working directory?(a) HOME(b) cd(c) pwd(d) dirThe question was posed to me in class test.I'd like to ask this question from File Handling Commands: pwd, cd topic in portion The File System of Unix |
|
Answer» RIGHT choice is (c) pwd For explanation I would SAY: pwd command is used for checking our current directory. Current directory is the directory in which we are currently WORKING. pwd DISPLAYS the ABSOLUTE pathname i.e. with respect to the root directory. |
|
| 34. |
Which command is used for changing the current directory?(a) cd(b) cp(c) pwd(d) rmThis question was addressed to me in final exam.My question comes from File Handling Commands: pwd, cd in division The File System of Unix |
|
Answer» The correct answer is (a) cd |
|
| 35. |
We should avoid filenames starting with a – (hyphen).(a) True(b) FalseThe question was asked in examination.Question is taken from Categories of Files in chapter The File System of Unix |
|
Answer» RIGHT ANSWER is (a) True To ELABORATE: Those files which have FILENAME STARTING with a (-) are difficult to remove and many commands can interpret such filename as an option which could lead to a miserable situation. |
|
| 36. |
_____ and _____ cannot be used in a filename.(a) /, NULL(b) $,^(c) ., %(d) NULL, $This question was addressed to me during an interview for a job.This interesting question is from Categories of Files topic in section The File System of Unix |
|
Answer» Right choice is (a) /, NULL |
|
| 37. |
Filenames in UNIX are not case-sensitive.(a) True(b) FalseI got this question in a job interview.My enquiry is from Categories of Files in chapter The File System of Unix |
|
Answer» The CORRECT choice is (b) False |
|
| 38. |
UNIX imposes no rule for framing filename extensions.(a) True(b) FalseThis question was posed to me in an online quiz.I'd like to ask this question from Categories of Files topic in division The File System of Unix |
|
Answer» Right answer is (a) True |
|
| 39. |
The root directory is represented by ___(a) \(b) /(c) *(d) $The question was posed to me during an interview for a job.My question is based upon Categories of Files in portion The File System of Unix |
|
Answer» Right answer is (b) / |
|
| 40. |
UNIX treats everything as a file.(a) True(b) FalseI got this question in an international level competition.Origin of the question is Categories of Files topic in section The File System of Unix |
|
Answer» Correct option is (a) True |
|
| 41. |
Device files are used by the kernel for operating the device.(a) True(b) FalseI got this question in an interview for job.This interesting question is from Categories of Files topic in chapter The File System of Unix |
|
Answer» Correct choice is (a) True |
|
| 42. |
When we log in, the UNIX places us in a directory, called ______ directory(a) home(b) main(c) parent(d) currentThis question was posed to me in class test.I want to ask this question from Categories of Files in division The File System of Unix |
|
Answer» RIGHT answer is (a) home The explanation: When we log in, the system automatically places us in a DIRECTORY CALLED Home directory. We can change our directory if we want and can also VIEW our home directory USING the shell variable, HOME. |
|
| 43. |
What is a directory file?(a) a directory containing data(b) a directory containing details of the files and subdirectories it contains(c) a directory contains files(d) a directory containing data and filesI have been asked this question during an online exam.The query is from Categories of Files in chapter The File System of Unix |
|
Answer» Correct option is (b) a directory containing details of the files and SUBDIRECTORIES it CONTAINS |
|
| 44. |
Each entry of directory file has component(s) namely _____(a) filename(b) inode number(c) filename and inode number(d) file sizeI had been asked this question in an online quiz.My enquiry is from Categories of Files in portion The File System of Unix |
|
Answer» Correct option is (c) filename and inode number |
|
| 45. |
The most common file type is ___(a) ordinary file(b) directory file(c) device file(d) ordinary file and directory fileThis question was posed to me in an interview for internship.I need to ask this question from Categories of Files in section The File System of Unix |
|
Answer» The correct option is (a) ordinary file |
|
| 46. |
In how many broad categories, files are divided into UNIX?(a) 2(b) 4(c) 5(d) 3I had been asked this question in an online quiz.Question is taken from Categories of Files topic in chapter The File System of Unix |
|
Answer» Right ANSWER is (d) 3 |
|
| 47. |
In UNIX, the file name and file size are stored in the file itself.(a) True(b) FalseI got this question in class test.My question is from Categories of Files in division The File System of Unix |
|
Answer» RIGHT CHOICE is (B) False Explanation: A UNIX file’s size is not stored in the file, nor its name. All this information is stored separately in a SEPARATE area of hard disk which is not DIRECTLY accessible to humans, but only to the kernel. |
|
| 48. |
A file is a container for storing information.(a) True(b) FalseThis question was posed to me by my school teacher while I was bunking the class.The above asked question is from Categories of Files in chapter The File System of Unix |
|
Answer» Correct choice is (a) True |
|