linux

Linux Wildcard Characters




Wildcards are place holders used to allow users to search for or use multiple files with similar names. The subject of wildcards is part of the larger subject of regular expressions in linux. Two of the most common wildcards are "*" and "?".



The asterisk, "*", represents any character or string of characters. The entry a*.txt could refer to apple.txt as well as array.txt.

The question mark represents a single character. The entry a?.txt could refer to ab.txt and ab.txt, but not array.txt.

For example, to find a file called "sneaksomething.txt," enter: ls sneak*.txt

The linux shell lists every file that matches that pattern: sneakers.txt


Regular expressions are more complex than the straightforward asterisk or question mark.

Here are wildcards and regular expressions:

* — Matches all characters

? — Matches one character

\* — Matches the * character

\? — Matches the ? character

\) — Matches the ) character




                           send to a friend                                            moby@mylinuxplanet.com      

Please free to mail your queries and feed back at moby@mylinuxplanet.com a free linux tutorial website


Linux Tutorials

About This Site

History of Linux

Open Source

File system terms

Linux File System

History of Shell

Opening a Shell Prompt

Shell Prompt Basics

Linux Shell Prompt

Linux Commands

Viewing Text Files From The Shell

Manipulating Information from Shell

Linux Help

Managing Linux Files

Multiple Commands Usage

Managing Linux Directories

Linux Directory Commands

Locating And Search Commands

Command History

Wildcard Characters

Creating a Linux User

Ownership And Permissions

File Compression

Virtual Console Logout & Shutdown

Running Background Process

Shell Prompt Keyshortcuts

Clearing And Resseting Terminal

Vi Editor

Shell Scripting

Installing and Removing Applications

Servers in Linux

Our Link Partners