Using wildcard metacharacters and options to the ls command, view the following:
ID: 3845108 • Letter: U
Question
Using wildcard metacharacters and options to the ls command, view the following:
a. All the files that end with .cfg under the /etc directory
b. All hidden files in the /home/user1 directory
c. The directory names that exist under the /var directory
d. All the files that start with the letter "a" underneath the /bin directory
e. All the files that have exactly three letters in their filename in the /bin directory
f. All files that have exactly three letters in their filename and end with either the letter "t" or the letter "hr" in the /bin directory
Explanation / Answer
a) All the files that end with .cfg under the /etc directory b
ls -l /etc/*.cfg
b) All hidden files in the /home/user1 directory c
c) The directory names that exist under the /var directory d
ls -d /var/*
d) All the files that start with the letter “a” underneath the /bin directory
ls /bin/[a]*
ls -d /bin/[a]*
e) All the files that have exactly three letters in their filename in the /bin directory
f) All files that have exactly three letters in their filename and end with either the letter “t” or the letter “h” in the /bin directory
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.