Problem

In this hands-on project, you use the ls command alongside wildcard metacharacters in yo...

In this hands-on project, you use the ls command alongside wildcard metacharacters in your shell to explore the contents of your home directory.

1. Switch to a command-line terminal (tty2) by pressing Ctrl+Alt+F2 and log in to the terminal using the user name of root and the password of secret.

2. At the command prompt, type pwd, press Enter, and ensure that /root is displayed, showing that you are in the root user’s home folder. At the command prompt, type ls. How many files with a name beginning with the word “sample” exist in /root?

3. At the command prompt, type ls * and press Enter. What is listed and why?

4. At the command prompt, type ls sample and press Enter. What is listed and why?

5. At the command prompt, type ls sample? and press Enter. What is listed and why?

6. At the command prompt, type ls sample?? and press Enter. What is listed and why?

7. At the command prompt, type ls sample[13] and press Enter. What is listed and why?

8. At the command prompt, type ls sample[!13] and press Enter. What is listed and why? How does this compare with the results from Step 7?

9. At the command prompt, type ls sample[1-3] and press Enter. What is listed and why?

10. At the command prompt, type ls sample[!1-3] and press Enter. What is listed and why? How does this compare with the results from Step 9?

11. Type exit and press Enter to log out of your shell.

Step-by-Step Solution

Request Professional Solution

Request Solution!

We need at least 10 more requests to produce the solution.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the solution will be notified once they are available.
Add your Solution
Textbook Solutions and Answers Search