Using wildcards

You might think of wildcards as being placeholders for omitted letters or numbers. For example, if you're looking for a file but aren't sure whether you named it kidnews or kidupdate, you can include a wildcard to stand for the part you're uncertain of. That is, you could list the files of a directory with ls kid*, (Code Listing 1.7), which would list all files starting with the characters "kid". In the resulting list, you'd find a file named kid if there were one, as well as files that begin with kid but have varying endings, such as kidnews (ah-ha, the lost file!), kiddo, or kidneypie.

You can use wildcards for just about any purpose in UNIX, although listing files and directories will likely be the most common use. Just follow ...

Get Unix: Visual QuickStart Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.