Sunday 25 September 2022

MS-DOS Multiple Choice Questions-2


1.    Which command displays all the files having the same name but different extensions?

a.    Dir filename.*

b.    Dir filename.ext

c.    Dir *.sys

d.    Dir *.ext


Correct Answer: a. Dir filename.*

Explanation: * is a wild card character that stands for all any character. When you specify filename.*, it meant filename should be specified one but extension can be any. Second option lists only the specified filename.exe and third and fourth commands lists all files with sys extension and specified extension.


2.    Which command displays only file and directory names without size, date and time information?

a.    Dir/w

b.    Dir a:

c.    Dir /b

d.    Dir /s


Correct Answer: dir/b

Explanation: dir/b command barely lists the names of files and directories without any other information like size, date, time etc.


3.    Which command displays comma for thousand separating on file size while listing?

a.    Dir/w

b.    Dir/s

c.    Dir/b

d.    Dir/c


Correct Answer: d. Dir/c

Explanation: Using comma for separating thousand in file size is by default on. You can use dir/-c to remove comma from the listing. /C stands for comma.


4.    Which command is used to display all the files having the (.exe) extension but different filename?

a.    Dir filename.*

b.    Dir filename.ext

c.    Dir *.sys

d.    Dir *.ext


Correct Answer: d. Dir *.ext

Explanation: First two options are obviously wrong since specifying filename will list for that filename only. Since we need to list only with .ext extension fourth option is correct. Third option displays all files with sys extension.


5.    Which command should be used to display all files within the specified subordinate directory of the subdirectory?

a.    Dir \ pathname

b.    Dir \ pathname\pathname

c.    Dir / ch

d.    Dir \pathname\filename


Correct Answer: b. Dir \pathname\pathname

Explanation: The subordinate directory of subdirectory can be accessed through the path sequence pathname\pathname and dir command lists the files of that location.


6.    Which command displays the directory list including files in tree structure?

a.    Dir/s/f

b.    Tree/f

c.    Tree/s/f

d.    Dir/f


Correct Answer: b. Tree/f

Explanation: Tree command lists the directory structure in tree structure and /f switch of tree command includes the filenames in the structure.


7.    Which command will be used to display a file within the specified directory of pathname?

a.    Dir \pathname

b.    Dir \pathname\pathname

c.    Dir/ch

d.    Dir \pathname\filename


Correct Answer: d. Dir \pathname\filename

Explanation: Displaying a file which is inside specified directory can be done by specifying a directory name \ and filename.


8.    Which command creates a directory or subdirectory?

a.    Dir

b.    Mkdir

c.    Md

d.    Both b and c


Correct Answer: d. Both b and c

Explanation: MK command and MKDIR both commands are equivalent and can be used to create subdirectories. Dir only lists directory but can’t create.

9.    Which command displays current directory name or change from one to another?

a.    Chdir

b.    Cd

c.    Mkdir

d.    Both a and b


Correct Answer: d. Both a and b

Explanation: CD and CHDIR commands are equivalent and both used to change current working directory to another one. MKDIR creates a new directory and can’t be used to change.


10.Which command is used to delete the directory that is empty?

a.    Del *.*

b.    RD

c.    Erase

d.    MD


Correct Answer: b. RD

Explanation: RD command or RMDIR commands can be used to remove a directory if it is empty. Del command and Erase commands are used to delete files not directories. MD creates a new directory and can’t remove directory.