Timedora
Free Practice Quiz Question List

Browsing and Printing Files with `less` and `cat` Online Quiz Questions

Use this free practice quiz with 20 questions to review Browsing and Printing Files with `less` and `cat`, test your knowledge, and prepare for your next test or exam.

20 questions
01
Choose one
1 point

You need to browse a long log file one screen at a time and move around in it. Which command should you use?

  1. A

    cat system.log

  2. B

    less system.log

  3. C

    echo system.log

  4. D

    print system.log

02
Choose all
1 point

Select all statements that accurately describe cat.

  1. A

    When given multiple filenames, cat prints their contents in order.

  2. B

    cat automatically inserts page breaks between files.

  3. C

    cat copies file contents to standard output without interpreting the text.

  4. D

    cat lets you move backward and forward through a file one screen at a time.

03
Written response
1 point

Which command name is used to browse a text file one screen at a time?

04
Fill in the blank
1 point

The command writes a file’s contents to the terminal.

05
Open ended
1 point

You have a long text file and need to move around in it rather than print all its contents to the terminal at once. Which command would you choose, and how could you navigate through the file? Briefly contrast it with the other command.

06
Choose all
1 point

Select all the controls that are described for navigating a file or finding another search match in less.

  1. A

    Use the arrow keys to move through the file.

  2. B

    Use Page Up and Page Down to move through the file.

  3. C

    Press q to find the next search match.

  4. D

    Press n to find the next search match.

07
True or false
1 point

cat interprets the text in a file as it prints it to standard output.

  1. A

    True

  2. B

    False

08
Written response
1 point

After finding a match with a search in less, which single key finds the next match?

09
Fill in the blank
1 point

To browse system.log one screen at a time, enter the command: .

10
Choose one
1 point

Which command is best for interactively browsing a long file one screen at a time?

  1. A

    cat system.log

  2. B

    less system.log

  3. C

    print system.log

  4. D

    search system.log

11
True or false
1 point

cat interprets a text file and adds page breaks as it prints the contents.

  1. A

    True

  2. B

    False

12
Written response
1 point

Which single key quits less?

13
Choose one
1 point

What happens when cat is given multiple filenames?

  1. A

    cat prints only the first file.

  2. B

    cat combines the files but sorts their contents.

  3. C

    cat prints the contents in filename order.

  4. D

    cat displays each file in a separate interactive screen.

14
True or false
1 point

In less, entering /word and pressing Enter searches forward for word.

  1. A

    True

  2. B

    False

15
Written response
1 point

After searching in less, which single key finds the next match?

16
Choose one
1 point

Which command prints the contents of notes.txt directly to the terminal?

  1. A

    Use cat notes.txt.

  2. B

    Use less notes.txt.

  3. C

    Use /notes.txt.

  4. D

    Use n notes.txt.

17
Choose one
1 point

Which controls can you use to move through a file in less?

  1. A

    Use /word and press Enter.

  2. B

    Use the arrow keys or Page Up and Page Down.

  3. C

    Use n to move through every screen.

  4. D

    Use q to move forward one page.

18
Choose one
1 point

You need to browse a long text file one screen at a time and move around without printing the entire file to the terminal. Which command should you use?

  1. A

    cat, because it displays a file one screen at a time

  2. B

    less, because it lets you browse a file one screen at a time

  3. C

    cat, because it adds page breaks to long output

  4. D

    less, because it prints all supplied files in order

19
Choose one
1 point

What happens when you run cat with multiple filenames?

  1. A

    cat prints only the first file unless page breaks are enabled.

  2. B

    less prints every file in the order given, then exits.

  3. C

    cat prints the contents of multiple files in the order given.

  4. D

    cat combines the files but rearranges their lines alphabetically.

20
Choose one
1 point

While browsing with less, how do you search forward for error and then move to the next match?

  1. A

    Type /word and press Enter; press n to find the next match.

  2. B

    Type word and press Enter; press q to find the next match.

  3. C

    Press n to begin the search; type /word to move to the next match.

  4. D

    Type /word and press Enter; press Page Down to find the next match.