Sarathlal N

Use wild card in Linux commands

A wild card is a character that can be used as a substitute for any of a class of characters in a command. It can increase the flexibility and efficiency of our commands.

Star Wild card

ls ab*

The above command will list all file name that start with ab like abc, abcd, ab3ve, ab etc if they exist.

Question Mark Wild card

ls ab?

The above command will list all file name that have three characters in its name & the name must start with ab and the last character will be anything like abc, ab3, abZ etc if they exist.

Square Brackets Wild card

ls ab[123]

The above command will list files that have name like ab1, ab2 and ab3 if they exist.

We can also specify a range for this wild card.

ls ab[a-f]

ls ab[1-9]

ls ab[a-z]

Looking for a skilled WordPress/WooCommerce developer? I'm currently available for freelance, contract, or full-time remote opportunities! Let's create something amazing together. Send me a quick message, and I'll respond within 24 hours!

Recent Posts

  1. Automating Code Linting with GitHub Actions for WordPress Plugins
  2. Comprehensive Guide to Linting PHP, JavaScript, and CSS in WordPress Plugins Using Composer
  3. The Ultimate Guide to Indexing in Database Design
  4. Understanding 'update_meta_cache' in WordPress - When to Use It, When Not to, and Its Impact on Database Queries
  5. A Guide to Configuring JavaScript and SCSS Paths in WordPress Plugins with @wordpress/scripts

Your Questions / Comments

If you found this article interesting, found errors, or just want to discuss about it, please get in touch.