San Diego State University logo

*Technical Briefs*
ROHAN help Files

----------------------------------------------------------------------

wildcards or metacharacters

If you have several files in your directory with similar names, you can list them all at once by using wildcards or metacharacters. These special characters are:

  • * - replaces any number of characters in a file name. For example:

    rohan%  ls  *tion
    will list all files in the directory that end in tion (such as solution, polution or execution)

    rohan%  ls  Sa*

    will list all files in the directory that begin with Sa (such as Saturday, Sadly or Sarah).

  • ? - replaces any one character only. For example:

    rohan%  ls s?t
    

    will list all files in the directory that start with s, end in t and are three letters long (sit or sat).

  • [ ] - replaces any number of characters between the brackets. For example:

    rohan%  ls  [bcs]at

    will list all files in the directory that start with b, c, or s and end with at (bat, cat or sat).

    rohan%  ls  chap[1-3]
    will list all files that start with chap and end in 1, 2 or 3.

----------------------------------------------------------------------


BACK ROHAN Help Index | Academic Computing Handouts, Manuals, and Help Files

This page last modified: December 12, 2002
Send comments/suggestions about this web page to webmaster@rohan.sdsu.edu

SDSU Faculty and Students may send questions about software on ROHAN or ROHAN UNIX problems to problems@rohan.sdsu.edu