Which of the following commands will John use to accomplish the task?

John works as a Network Administrator for Perfect Solutions Inc. The company has a Linux-based
network. John is working as the root user on the Linux operating system. He wants to delete all
files whose names end with a number. Which of the following commands will John use to
accomplish the task?

John works as a Network Administrator for Perfect Solutions Inc. The company has a Linux-based
network. John is working as the root user on the Linux operating system. He wants to delete all
files whose names end with a number. Which of the following commands will John use to
accomplish the task?

A.
rm *[0-9]

B.
rm [^0-9]

C.
rm ^[0-9]

D.
rm [0-9]*

Explanation:

The rm *[0-9] command deletes all files whose names end with a number.
Answer option B is incorrect. The rm [^0-9] command deletes all files except those having names
ending with a number.
Answer option C is incorrect. The rm ^[0-9] command deletes all files whose names begin with a
number.
Answer option D is incorrect. The rm [0-9]* command also deletes all files whose names begin
with a number.



Leave a Reply 0

Your email address will not be published. Required fields are marked *