Timedora
Free Online Flashcard Deck

Viewing Files with `cat` and `less` Free Online Flashcards

Study Viewing Files with `cat` and `less` with 12 free online flashcards. Review key terms, definitions, and concepts with this interactive flashcard deck.

12 cards
01
Front

How do you display a text file with `cat`?

Back

Use `cat filename` to write the file’s contents to the terminal.

02
Front

What happens when `cat` receives multiple filenames?

Back

`cat` prints the contents of multiple files in the order their filenames are given.

03
Front

Why is `cat` convenient for short files but less suitable for long output?

Back

Long output from `cat` may scroll past before you can read it, so it is most convenient for short files.

04
Front

How does `less` display a file?

Back

Use `less filename` to browse a file one screen at a time.

05
Front

How do you move through a file in `less`?

Back

In `less`, use the arrow keys or Page Up and Page Down to move through the file.

06
Front

How do you search forward for a word in `less`?

Back

In `less`, type `/word` and press Enter to search forward for `word`.

07
Front

In `less`, what key finds the next search match?

Back

After a search in `less`, press `n` to find the next match.

08
Front

How do you quit `less`?

Back

Press `q` to quit `less`.

09
Front

Which viewer is useful for browsing a long file one screen at a time?

Back

Use `less` for a long file when you want to browse it one screen at a time instead of dumping all its contents to the terminal.

10
Front

When is `cat` a convenient choice for viewing a file?

Back

Use `cat` for a short file when printing its contents directly to the terminal is convenient.

11
Front

How does browsing with `less` differ from displaying with `cat`?

Back

`cat` prints the file contents to standard output; `less` lets you browse one screen at a time and move around the file.

12
Front

What advantage does `less` offer over dumping a file’s full contents to the terminal?

Back

`less` lets you move around a file without dumping the entire file to the screen.