Copyright 2009 sun microsystems inc all rights

This preview shows page 169 - 172 out of 390 pages.

Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision C.1 Asterisk ( * ) Character The asterisk ( * ) character is also called the wild card character and represents zero or more characters, except the leading period ( . ) of a hidden file. To list all files and directories that start with the letter f followed by zero or more other characters, enter the following commands: $ cd $ ls f* feathers file.1 file.2 file.3 file4 fruit2 feathers_6 file1 file2 file3 fruit $ To list all files and directories that start with the letter d followed by zero or more other characters, enter the following command: $ ls d* dante dante_1 dir1: coffees fruit trees dir2: beans notes recipes dir3: cosmos moon planets space sun vegetables dir4: constellation memo roses dir5: dir10: planets $ Oracle University and MULTIREDE INFORMÁTICA S.A use only THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Using the Shell Metacharacters 6-6 Solaris™ 10 Operating System Essentials Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision C.1 To list all files and directories that end with the number 3 , preceded by zero or more characters, enter the following command: $ ls *3 file.3 file3 dir3: cosmos moon planets space sun vegetables $ Question Mark ( ? ) Character The question mark ( ? ) character represents any single character except the leading period ( . ) of a hidden file. The question mark (?) character is also called a wild card character. To list all files and directories that start with the string dir and followed by one other character, enter the following command: $ ls dir? dir1: coffees fruit trees dir2: beans notes recipes dir3: cosmos moon planets space sun vegetables dir4: constellation memo roses dir5: $ If no files match an entry using the question mark (?) character, an error message appears. $ ls z? z?: No such file or directory $ Oracle University and MULTIREDE INFORMÁTICA S.A use only THESE eKIT MATERIALS ARE FOR YOUR USE IN THIS CLASSROOM ONLY. COPYING eKIT MATERIALS FROM THIS COMPUTER IS STRICTLY PROHIBITED
Using the Shell Metacharacters Using Commands Within the Shell 6-7 Copyright 2009 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision C.1 Square Bracket ( [] ) Characters The square bracket ( [] ) characters represent a set or range of characters for a single character position. A set of characters is any number of specific characters; for example, [acb] . The characters in a set do not generally need to be in any order. For example, [abc] is the same as [cab] . A range of characters is a series of ordered characters. A range lists the first character, a hyphen ( - ), and the last character, for example, [a–z] or [0–9] . When you specify a range, arrange the characters in the order that you want them to appear in the output. Use [A–Z] or [a–z] to search for any uppercase or lowercase alphabetical character, respectively.

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture