Linux Using wildcard metacharacters and options to the ls co

Linux 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 “h” in the /bin directory

Solution

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  

Linux 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

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site