Skip to content
GK24
Computer AwarenessEasy

The MS-DOS command TYPE, which displays the contents of a text file on the screen, corresponds to which Linux command?

  1. A.cat
  2. B.touch
  3. C.echo
  4. D.grep

Correct answer

A. cat

Explanation

The correct answer is A, cat. The cat command, short for concatenate, writes the contents of one or more files to the standard output, which is normally the screen, and so does the work of TYPE in MS-DOS. It can also join files together when more than one name is given. Option B is wrong because touch creates an empty file if the name does not exist and otherwise only updates the time stamp of the file; it never shows the contents. Option C is wrong because echo prints the text or the value of a variable written after it, not the contents of a file. Option D is wrong because grep searches for a pattern and prints only the lines that match it, which makes it the equivalent of the DOS command FIND rather than of TYPE. For long files, less and more are used instead of cat so that the text can be read one screen at a time.

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

View all
Q4.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.