Bookmark this page

Quiz: Matching File Names with Shell Expansions

Choose the correct answers to the following questions:

  1. 1.

    Which pattern will match only filenames ending with "b"?

    A

    b*

    B

    *b

    C

    *b*

    D

    [!b]*

  2. 2.

    Which pattern will match only filenames beginning with "b"?

    A

    b*

    B

    *b

    C

    *b*

    D

    [!b]*

  3. 3.

    Which pattern will match only filenames where the first character is not "b"?

    A

    b*

    B

    *b

    C

    *b*

    D

    [!b]*

  4. 4.

    Which pattern will match all filenames containing a "b"?

    A

    b*

    B

    *b

    C

    *b*

    D

    [!b]*

  5. 5.

    Which pattern will match only filenames that contain a number?

    A

    *#*

    B

    *[[:digit:]]*

    C

    *[digit]*

    D

    [0-9]

  6. 6.

    Which pattern will match only filenames that begin with an uppercase letter?

    A

    ^?*

    B

    ^*

    C

    [upper]*

    D

    [[:upper:]]*

    E

    [[CAP]]*

  7. 7.

    Which pattern will match only filenames at least three characters in length?

    A

    ???*

    B

    ???

    C

    \3*

    D

    +++*

    E

    ...*

Revision: rh124-8.2-df5a585