ACE-P-ALE1-04 practice question 4 of 35
In file globbing, which symbol matches any single character?
Full set: 100 questionsIn shell pathname expansion, commonly known as file globbing, the question mark (?) is a wildcard character that matches exactly one of any character. For example, the pattern file?.txt would match file1.txt, fileA.txt, and file-.txt, but it would not match file.txt or file10.txt. This functionality is standard across Unix-like shells, including the one used in Arista's Extensible Operating System (EOS).
A. \: The asterisk () is a wildcard that matches any string of zero or more characters, not a single character.
C. []: The square brackets ([]) match a single character from a specified set or range of characters, not any single character.
D. .: The period (.) is treated as a literal character in file globbing and is not a wildcard for matching any single character.
1. GNU Bash Reference Manual:
Section 3.5.8.1 Pattern Matching: "An asterisk () matches any string of characters, including the null string. A question mark (?) matches any single character."
Source: Free Software Foundation, GNU Bash Reference Manual, Version 5.2.
2. Arista EOS Central Documentation:
Article: Working with Files on an Arista Switch: The documentation demonstrates the use of standard Linux file management commands and wildcards. For instance, in the context of the delete command, it notes, "Wildcards can be used to delete multiple files at once (e.g., delete flash:.log)." This confirms that EOS employs standard shell globbing patterns where ? represents a single character.
Source: Arista EOS Central, "Working with Files on an Arista Switch," Command Line Interface (CLI) section.
3. University Courseware (MIT OpenCourseWare):
The Missing Semester of Your CS Education, Lecture 2: Shell Tools and Scripting: "Globbing lets you use special characters to create patterns that match filenames. ? matches any single character."
Source: MIT OpenCourseWare, "The Missing Semester of Your CS Education," 2020.
Keep practicing
Take the free ACE-P-ALE1-04 practice test
Ten exam-style questions with answers and explanations, plus the exam facts and study guides.
More questions
Other ACE-P-ALE1-04 practice questions
- Question 1When using the sudo command to run something as root, which password is required?
- Question 2Which utility can be used to remove sections or columns of each line of input?
- Question 3The ps –ef command is from which UNIX variant?
- Question 5If the system is swapping, what can be done to alleviate the problem?
- Question 6When scripting in bash, it is recommended to always use which symbols around your variabl…
- Question 7Which utility can be used to merge sequentially corresponding lines of input streams into…
