Bookmark this page

Quiz: Execute Commands with the Bash Shell

Execute Commands with the Bash Shell

Choose the correct answers to the following questions:


  1. 1.

    Which Bash command displays the last five lines of the /var/log/messages file?

    A

    head -n 10 /var/log/messages

    B

    tail 10 /var/log/messages

    C

    tail -n 5 /var/log/messages

    D

    tail -l 10 /var/log/messages

    E

    less /var/log/messages

  2. 2.

    Which Bash shortcut or command separates commands on the same line?

    A

    Pressing Tab

    B

    history

    C

    ;

    D

    !string

    E

    Pressing Esc+.

  3. 3.

    Which Bash command is used to change a user's password?

    A

    password

    B

    pass

    C

    passwd

    D

    usermod

    E

    userpassword

  4. 4.

    Which Bash command is used to display the file type?

    A

    file

    B

    less

    C

    cat

    D

    history

    E

    view

  5. 5.

    Which Bash shortcut or command is used for completing commands, file names, and options?

    A

    ;

    B

    !number

    C

    history

    D

    Pressing Tab

    E

    Pressing Esc+.

  6. 6.

    Which Bash shortcut or command re-executes a specific command in the history list?

    A

    Pressing Tab

    B

    !number

    C

    !string

    D

    history

    E

    Pressing Esc+.

  7. 7.

    Which Bash shortcut or command jumps to the beginning of the command line?

    A

    !number

    B

    !string

    C

    Pressing Ctrl+LeftArrow

    D

    Pressing Ctrl+K

    E

    Pressing Ctrl+A

  8. 8.

    Which Bash shortcut or command displays the list of previously executed commands?

    A

    Pressing Tab

    B

    !string

    C

    !number

    D

    history

    E

    Pressing Esc+.

  9. 9.

    Which Bash shortcut or command copies the last argument of previous commands?

    A

    Pressing Ctrl+K

    B

    Pressing Ctrl+A

    C

    !number

    D

    Pressing Esc+.

Revision: rh124-9.3-770cc61