Unix File Management MCQs
File Management MCQs : This section focuses on "File Management" in unix. These Multiple Choice Questions (MCQ) should be practiced to improve the unix skills required for various interviews (campus interviews, walk-in interviews, company interviews), placements, entrance exams and other competitive examinations.
1. How many types of files are there in Unix?
A. 2
B. 3
C. 4
D. 5
View Answer
Ans : B
Explanation: In Unix, there are three basic types of files : Ordinary, Directories, Special Files.
2. Which of the following is true about files?
A. All data in Unix is organized into files.
B. All files are organized into directories.
C. The directories are organized into a tree-like structure called the filesystem.
D. All of the above
View Answer
Ans : D
Explanation: All above options are correct about files.
3. Which command is used to list all the files?
A. ld
B. lr
C. ls
D. lp
View Answer
Ans : C
Explanation: ls command is used to list all files.
4. Which of the following symbol represents the current directory?
A. Double dot (..)
B. Dollar dot($.)
C. Single dot (.)
D. Hash dot(#.)
View Answer
Ans : C
Explanation: Single dot (.) : This represents the current directory.
5. Which of the following syntax is used for creating files in VI editor?
A. $# vi filename
B. $ vi filename
C. # vi filename
D. & vi filename
View Answer
Ans : B
Explanation: $ vi filename syntax is used for creating files in VI editor.
6. The most common file type is ___.
A. ordinary file
B. directory file
C. device file
D. ordinary file and directory file
View Answer
Ans : A
Explanation: The most common file type is an ordinary file or a regular file. It contains data as a stream of characters. Ordinary files are also of two types, text file and binary file.
7. Each entry of directory file has component(s) namely _____.
A. filename
B. inode number
C. file size
D. Both A and B
View Answer
Ans : D
Explanation: Each entry has two components: Filename and unique identification number (called inode number).
8. _____ and _____ cannot be used in a filename.
A. /, NULL
B. $,^
C. ., %
D. NULL, $
View Answer
Ans : A
Explanation: / and NULL are the characters which cannot be used in a filename.
9. How many stream Unix program has?
A. 2
B. 3
C. 4
D. 5
View Answer
Ans : B
Explanation: Unix program has three streams (files) opened for it when it starts up : stdin stdout and sdterr.
10. What is the associated file descriptor for stdout?
A. 0
B. 1
C. 2
D. -1
View Answer
Ans : B
Explanation: stdout : This is referred to as the standard output and the associated file descriptor is 1.
Discussion