Which of the following examples for Bash file globbing matches a file named root-can-do-this.txt when used in the directory holding that file? (Choose three correct answers.)
Which of the following examples for Bash file globbing matches a file named root-can-do-this.txt when used in the directory holding that file? (Choose three correct answers.)
To match the file named root-can-do-this.txt in the specified directory using Bash globbing, we need to closely examine each pattern. Option A (root*can?do-this.{txt,odt}) will match the file because it uses an asterisk (*) to match any characters between 'root' and 'can' and a question mark (?) to match any single character between 'can' and 'do-this'. Option B (r[oOoO]t-can-do*.txt) will match as it uses a character class [oOoO] to match 'o' or 'O' in 'root' and an asterisk (*) to match any characters after 'do-', and ends with .txt which matches the file extension. Option C ({root,user,admin}-can-??-this.txt) matches as it uses brace expansion to match 'root', 'user', or 'admin', and double question marks (??) to match any two characters between 'can-' and 'this'. Other options contain patterns that do not correctly match the entire filename as specified.
Is A+C+E
Yes, you're right ACE
Indded! ACE