RHEL Linux - Red Hat System Administration Practice Exam

Disable ads (and more) with a membership for a one time $4.99 payment

Study for the RHEL Linux - Red Hat System Administration Exam. Enhance your knowledge with flashcards and multiple-choice questions, complete with hints and explanations. Prepare for your certification!

Practice this question and more.


Which wildcard pattern can be used to match any string of zero or more characters?

  1. *

  2. ?

  3. ~

  4. #

The correct answer is: *

The wildcard pattern that can be used to match any string of zero or more characters is the asterisk (*). In UNIX-like operating systems, including RHEL Linux, the asterisk serves as a versatile wildcard character in file matching. It allows users to specify patterns when performing operations like searching for files or executing commands. When the asterisk is used, it matches all characters in a given string, including an empty string. For example, using the pattern '*.txt' would match all files that end with the '.txt' extension, while the pattern '*' by itself would match all files in the directory, demonstrating its ability to represent any sequence of characters. The question's other options do not fulfill this purpose: the question mark (?) is a wildcard that matches exactly one character, not multiple characters or an empty string; the tilde (~) is typically used to reference home directories in the shell; and the hash mark (#) is not commonly used as a wildcard in this context. Hence, the asterisk is the correct choice for matching any string of zero or more characters.