You need to browse a long log file one screen at a time and move around in it. Which command should you use?
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.
Select all statements that accurately describe cat.
- A
When given multiple filenames,
catprints their contents in order. - B
catautomatically inserts page breaks between files. - C
catcopies file contents to standard output without interpreting the text. - D
catlets you move backward and forward through a file one screen at a time.
Which command name is used to browse a text file one screen at a time?
The command writes a file’s contents to the terminal.
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.
Select all the controls that are described for navigating a file or finding another search match in less.
- A
Use the arrow keys to move through the file.
- B
Use Page Up and Page Down to move through the file.
- C
Press
qto find the next search match. - D
Press
nto find the next search match.
cat interprets the text in a file as it prints it to standard output.
- A
True
- B
False
After finding a match with a search in less, which single key finds the next match?
To browse system.log one screen at a time, enter the command: .
Which command is best for interactively browsing a long file one screen at a time?
- A
cat system.log - B
less system.log - C
print system.log - D
search system.log
cat interprets a text file and adds page breaks as it prints the contents.
- A
True
- B
False
Which single key quits less?
What happens when cat is given multiple filenames?
- A
catprints only the first file. - B
catcombines the files but sorts their contents. - C
catprints the contents in filename order. - D
catdisplays each file in a separate interactive screen.
In less, entering /word and pressing Enter searches forward for word.
- A
True
- B
False
After searching in less, which single key finds the next match?
Which command prints the contents of notes.txt directly to the terminal?
- A
Use
cat notes.txt. - B
Use
less notes.txt. - C
Use
/notes.txt. - D
Use
n notes.txt.
Which controls can you use to move through a file in less?
- A
Use
/wordand press Enter. - B
Use the arrow keys or Page Up and Page Down.
- C
Use
nto move through every screen. - D
Use
qto move forward one page.
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?
- A
cat, because it displays a file one screen at a time - B
less, because it lets you browse a file one screen at a time - C
cat, because it adds page breaks to long output - D
less, because it prints all supplied files in order
What happens when you run cat with multiple filenames?
- A
catprints only the first file unless page breaks are enabled. - B
lessprints every file in the order given, then exits. - C
catprints the contents of multiple files in the order given. - D
catcombines the files but rearranges their lines alphabetically.
While browsing with less, how do you search forward for error and then move to the next match?
- A
Type
/wordand press Enter; pressnto find the next match. - B
Type
wordand press Enter; pressqto find the next match. - C
Press
nto begin the search; type/wordto move to the next match. - D
Type
/wordand press Enter; press Page Down to find the next match.
Related study packs and tools
3 Airway, Respiration, and Ventilation
Review EMT airway assessment, breathing mechanics, airway management, ventilation support, and priorities for common respiratory emergencies.
3 Airway, Respiration, and Ventilation
Learn how to assess airway and breathing, distinguish ventilation from oxygenation and respiration, provide appropriate support, and recognize common respiratory emergencies.
4 Cardiology and Resuscitation
Review cardiac assessment and emergencies, adult and pediatric CPR, AED use, and special resuscitation priorities for EMTs.
4 Cardiology and Resuscitation
A medium-difficulty quiz on EMT cardiovascular assessment, cardiac emergencies, CPR, AED use, and special resuscitation considerations.
4 Cardiology and Resuscitation
Learn how EMTs assess cardiac emergencies, recognize poor perfusion, and provide prompt care for cardiac arrest and other resuscitation situations.
6 Medical Emergencies
Review EMT priorities and key recognition and care principles for neurologic, metabolic, respiratory, toxicologic, behavioral, and environmental emergencies.
6 Medical Emergencies
A medium-difficulty quiz on recognizing and responding to medical emergencies within EMT scope and local protocols.
6 Medical Emergencies
Learn how EMTs approach medical emergencies, recognize time-sensitive conditions, provide care within their scope and local protocols, and arrange appropriate transport.
7 Obstetrics, Gynecology, and Pediatric Emergencies
A medium-difficulty quiz on practical assessment, treatment, and transport decisions in obstetric, gynecologic, neonatal, and pediatric emergencies.
8 EMS Operations
A medium-difficulty quiz on applying EMT operational principles to scene safety, communication, incident management, patient rights, and coordinated care.
9 Comprehensive EMT Practice Scenarios and Review
Review EMT exam domains and the priorities, interventions, and responsibilities that guide safe care in common emergency scenarios.
9 Comprehensive EMT Practice Scenarios and Review
Practice applying EMT scene safety, assessment, intervention, transport, and operational principles to realistic situations.