Logo 
Search:

Unix / Linux / Ubuntu Articles

Submit Article
Home » Articles » Unix / Linux / Ubuntu » CommandsRSS Feeds

Wild cards and examples in unix

Posted By: Adelbert Fischer     Category: Unix / Linux / Ubuntu     Views: 15793

Wild cards and examples in unix language.

Wild cards

The character which are used for a generalized pattern for file matching are called as wildcards.

Examples

ls chap01 chap04
use ls chap*
* is used as a metacharacter

Example of * for any characters

ls cap*

Example of ? for a single character

ls test-??.sh

Example of [jda] for single charater - either of j else d else a

ls [t]*.sh

Example of [x-z] files withing the x to z

ls [a-t]*

Example of [!jda] A single character that is not within the j ,d and a

ls [!t]*

Example of [!x-z] A single character that is not withing the range of x to z

ls [!a-t]*

Example of Escaping

develop the file with the name chap01, chap02, chap03, chap04.

ls chap0[1-4]
ls chap0\[1-4\]
  
Share: 


Didn't find what you were looking for? Find more on Wild cards and examples in unix Or get search suggestion and latest updates.

Adelbert Fischer
Adelbert Fischer author of Wild cards and examples in unix is from Frankfurt, Germany.
 
View All Articles

 
Please enter your Comment

  • Comment should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].

 
No Comment Found, Be the First to post comment!