PDF Version Available
This document is also available in PDF format: cmdsandwildcards.pdf
The PDF version includes bookmarks for easy navigation and is optimized for printing.
Accessibility Notice
This document is also available in HTML format at:
https://aholdengouveia.name/IntroLinux/labs/cmdsandwildcards.html
The HTML version provides enhanced accessibility features including keyboard navigation, screen reader support, responsive design, dark mode support, and high contrast options.
Objectives:
- Learn to use wildcards for file pattern matching
- Practice using the ls command with various wildcard patterns
- Understand the difference between ls and find commands
- Develop skills in efficiently locating files in Linux
Complete the following problems
References, a video, a PowerPoint and some notes are available at my website https://www.aholdengouveia.name/IntroLinux/cmdsandwildcards.html
How to setup for this lab
- We are going to create a test directory with numerous files and then use find and wildcards to locate files.
- Create a test subdirectory for this lab. I do NOT recommend using any spaces in the name of the files or folders.
- Using touch create at least a dozen files with different names with the following characteristics: enumerate
- Some start with f
- Some start with F
- Some start with a number
- Some end with a number
- Some do not have an f or F
- Some do not have a number
- At least one starts with a . (hidden file)
If you're struggling to think of names, use a naming scheme such as characters from your favorite video game, or locations and characters from favorite books etc. Make sure your files are full names of at least 5 characters, not just single letters/numbers For each of the problems you should start with ls and then figure out the pattern needed to show the requested information, then pick 1 of them to try with find instead. Demo of how to use ls is in the Linux FAQ videos https://youtube.com/playlist?list=PLQOmuLC45eoQlIMH7oCNL6yFP7kWQubBo&si=R1SFWzEPHDDo-VBJ
Problems to solve
- All files
- All files including hidden files.
- Files that start with “f”
- Files that start with “f” or “F”
- Files that have “f” or “F” anywhere in the name
- Files that have a digit in the name
- Files that start with a through d
- Files that end with 1 or 2
- Experiment with the find command by solving one of the above questions using find instead of ls.
Deliverables
- Each problem given should be numbered to match the question
- Make sure to list each command and the result.
- Make sure to take a screenshot of each successful command.
- Don't use one screenshot for everything, make sure each screenshot is labeled with which problem it solved.