Ch4 File Globbing Exam
-
Which of the following is not used for globbing?
*
[ ]
?
#
-
How many times can you use a
*
glob character in a pattern?- Two
- No limit
- Three
- One
-
Assuming at least one file matching the pattern is in the current directory, the command echo a* will display:
- Only the file named “a*”.
- All of the files in any directory that begin with an “a” character.
- All of the files in the current directory that begin with an “a” character.
- All of the files in the current directory that begin with an “a” or “A” character.
-
Assuming at least one file matching the pattern is in the current directory, the command echo ???a will display:
- All of the files in the current directory that have four characters in the file name with the last character being an “a” character.
- Only a file named ???a
- All of the files in the current directory that end with an “a” character.
- All of the files in the current directory that have four characters in the file name with the first character being an “a” character.
-
Which of the following characters can be used to negate (indicate not matching the following characters), when placed as the first of a set of characters enclosed in square brackets
[ ]
?(choose two)
^
?
!
~
-
The range defined inside of square brackets is based on the:
- ASCII text table
- ANSI text table
- Invalid question as ranges are not permitted
- Standard text table
-
To view the ASCII text table in Linux, you can use the following command:
text
echo ASCII
ascii
view ascii
ls ascii
-
Within square brackets, (for example:
[?]
) the?
character means:- Match zero or more of any ? characters
- Exactly one character
- Nothing, it has no meaning at all
- Match a ? character
-
You can combine glob characters in a single pattern, for example:
a??*[0-9]
.True or False?
- True
- False
-
Which command will display more information about globbing?
man -7 glob
man 7 glob
man 7 globbing
man globbing
-
Which of the following will match files that have the string
hello
somewhere in the file name?- echo *hello*
- echo hello*hello
- echo *hello
- echo hello*
-
The glob pattern
[a-d]
would match:- A file name with a single character that is either a a, b, c, or d.
- A file name with a single character that is either an a, -, or d.
- All files
- Nothing, this is an invalid glob pattern.
-
The glob pattern [!abc]*
- All files that start with either of the following characters: !, a, b or c.
- Nothing, this is an invalid glob pattern
- All files that start with any character except a, b or c
- All files
-
Which glob character matches exactly one character?
- .
- [
- ?
- *
-
Which glob character matches zero or more characters?
- *
- ?
- [
- .
-
Which two characters match a single character from a set of specified characters?
??
[]
..
**
-
Which two characters represent the empty string?
&&
**
..
""
-
Which of the following are glob characters?
(choose three)
- The asterisk
*
character - The question mark
?
character - The dash
-
character - The square brackets
[]
notation
- The asterisk
-
Brackets can be used to represent a range of characters.
True or False?
- True
- False
-
Which of these commands would return the files
/etc/game.conf, /etc/file.conf
and/etc/snap.conf
(choose two)
echo /etc/*?.*o?
echo /etc/????.*f
ls /etc/????.????
ls /etc/p????.**
Subscribe
0 Comments
Newest