Vidyalelo
Computer Science · Q17

UNIX

Engineering and GATE · Computer Science · question 17

Q17

Which command is used to concatenate all files beginning with the string 'emp' and followed by a non-numeric characters?

A.
cat emp[!0-9]
Answer
B.
more [emp][!0-9]
C.
cat emp[x-z]
D.
cat emp[a-z]
E.
None of the above

Answer: Option A

Solution

Answer: Option A
Solution:
In Unix, the command cat emp[!0-9] is used to concatenate all files beginning with the string 'emp' and followed by a non-numeric character. Here, the square brackets denote character classes, and the exclamation mark (!) negates the character class. So, [!0-9] matches any character that is not a numeric character.
Therefore, Option A: cat emp[!0-9] is the correct command to concatenate all files beginning with the string 'emp' and followed by a non-numeric character.