Skip to content
GK24
Computer AwarenessMedium

In MS-DOS, which wildcard character stands for exactly one character in a file name?

  1. A.The asterisk
  2. B.The question mark
  3. C.The backslash
  4. D.The colon

Correct answer

B. The question mark

Explanation

The correct answer is B, the question mark. A question mark in a file specification matches any single character in that position, so the command DIR FILE?.TXT lists FILE1.TXT and FILEA.TXT but not FILE12.TXT. Option A is wrong because the asterisk matches any group of characters, including none, which is why the pattern made of an asterisk, a dot and TXT selects every text file in a directory. Option C is wrong because the backslash is the separator between directory names in a DOS path and has nothing to do with matching. Option D is wrong because the colon follows a drive letter, as in the C drive written with a colon after it. The same two wildcards continue to work in the Windows command prompt and in Linux, where the shell expands them before the command runs.

Read the full article: MS-DOS and Linux Commands: Internal, External and Shell

View all
Q5.Computer AwarenessMedium

In Linux, the command chmod 777 on a file gives which set of permissions?

  1. A.Read and write to the owner only
  2. B.Read, write and execute to the owner, the group and others
  3. C.Read and execute to everyone, write to nobody
  4. D.Execute to the owner, read to the group, nothing to others
Show answer
Correct answer: B. Read, write and execute to the owner, the group and others

In the numeric form of chmod each of the three digits stands for one set of users, in the order owner, group and others, and each digit is the sum of read as 4, write as 2 and execute as 1.