LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-27-2008, 02:31 PM   #1
shridhar005
Member
 
Registered: Jul 2008
Posts: 90

Rep: Reputation: 17
Question Need information about wild cards


Hello gentlemen
I need all information regarding wild characters used in Linux. Including those used in shell scripting , used along with text processing commands .
 
Old 08-27-2008, 02:41 PM   #2
matthewg42
Senior Member
 
Registered: Oct 2003
Location: UK
Distribution: Kubuntu 12.10 (using awesome wm though)
Posts: 3,530

Rep: Reputation: 63
There are generally two types of pattern used in the shell and the coreutils:
  1. glob patterns - "*" means any combination of characters, "?" means any single character. This is what gets expanded when you do a command like:
    Code:
    ls -l *.txt
    The critical thing to realise if you come from a DOS background, and maybe even if you don't, is that the shell expands the glob pattern to all matching files before passing the list of argument to the command. In the example above, ls does not generally see the * - the shell expands this before it invokes ls. In the case when the pattern does not match any files (i.e. there are no files ending in ".txt"), the "*.txt" will be passed as a litereal string, but ls is not expected to treat it as a pattern - it will treat it as a literal string and try to list a file called "*.txt", which presumably will not be found.
  2. Regular expressions. Many core utilities like grep understand regular expressions (REs). RE's are a mini language for describing string patterns. There are a few variants of regular expressions, including standard REs, extended REs, Perl compatible REs. These arose as the original REs got extended to add new functionality. Read the regex manual page, and do some tutorials. Once you learn how to use REs, you will wonder how you ever coped without them.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how to do * wild cards in python donnied Programming 6 08-19-2008 10:26 PM
Nvidia, ATI, need some information on video cards please fakie_flip Linux - Hardware 4 09-22-2006 02:26 AM
ndiswrapper gone wild! konowdude Linux - Wireless Networking 2 12-28-2005 02:27 PM
Wild Cards using the find command -- grrr hpladd Linux - Newbie 9 07-14-2005 06:18 PM
More Players Supporting Wild-Cards? chime Linux - General 0 12-01-2004 11:21 AM


All times are GMT -5. The time now is 02:40 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration