Bookmark this page

Quiz: Match File Names with Shell Expansions

Match File Names with Shell Expansions

Choose the correct answers to the following questions:


  1. 1.

    Which pattern matches only file names that end with "b"?

    A

    b*

    B

    *b

    C

    *b*

    D

    [!b]*

  2. 2.

    Which pattern matches only file names that begin with "b"?

    A

    b*

    B

    *b

    C

    *b*

    D

    [!b]*

  3. 3.

    Which pattern matches only file names where the first character is not "b"?

    A

    b*

    B

    *b

    C

    *b*

    D

    [!b]*

  4. 4.

    Which pattern matches all file names that contain a "b"?

    A

    b*

    B

    *b

    C

    *b*

    D

    [!b]*

  5. 5.

    Which pattern matches only file names that contain a number?

    A

    *#*

    B

    *[[:digit:]]*

    C

    *[digit]*

    D

    [0-9]

  6. 6.

    Which pattern matches only file names that begin with an uppercase letter?

    A

    ^?*

    B

    ^*

    C

    [upper]*

    D

    [[:upper:]]*

    E

    [[CAP]]*

  7. 7.

    Which pattern matches only file names with at least three characters?

    A

    ???*

    B

    ???

    C

    \3*

    D

    +*

    E

    ...*

Revision: rh199-9.3-8dd73db