Study guide

2.2 Using the Command Line to Get Help

LPI Linux Essentials Certificate 010-160

Track your progress as you read

Finished sections get a check mark.

1 Introduction & Exam Overview

1.1 Current Exam Facts 1.2 Study Strategy & Blueprint Weights

2 Topic 1: The Linux Community and a Career in Open Source

1.1 Linux Evolution and Popular Operating Systems 1.2 Major Open Source Applications 1.3 Open Source Software and Licensing 1.4 ICT Skills and Working in Linux

3 Topic 2 Part A: Command Line Basics & Getting Help

2.1a Bash Shell, Command Syntax & Variables 2.1b Quoting, History & Safe Command Syntax 2.2 Using the Command Line to Get Help

4 Topic 2 Part B: Directories, Listing & File Operations

2.3 Using Directories and Listing Files 2.4 Creating, Moving and Deleting Files

5 Topic 3 Part A: Archiving & Searching Data

3.1 Archiving and Compression on the Command Line 3.2a Pipes, Redirection, and Basic Regular Expressions 3.2b grep and Text Extraction Tools

6 Topic 3 Part B: Turning Commands into Scripts

3.3a Script Basics: Shebang, Variables, and Arguments 3.3b Loops, Exit Status, and Simple Conditionals 3.3c Editors, chmod +x, and Running Scripts

7 Topic 4 Part A: Choosing an OS, Hardware & FHS Basics

4.1 Choosing an Operating System 4.2 Understanding Computer Hardware 4.3a Where Programs and Configuration Live (FHS Basics)

8 Topic 4 Part B: Processes, Logs & Networking

4.3b Processes, Memory & Logs 4.4 Your Computer on the Network

9 Topic 5: Security and File Permissions

5.1 Basic Security and Identifying User Types 5.2 Creating Users and Groups 5.3 Managing File Permissions and Ownership 5.4 Special Directories and Files

2.2 Using the Command Line to Get Help

Key Takeaways Explain This Topic AI

man displays the manual page for a command, file format, or topic; press q to quit the pager and use /pattern to search within a page

Manual pages are grouped into numbered sections — section 1 is user commands, 5 is file formats, 8 is administration commands

info often provides a hyperlinked Texinfo manual that can be deeper than a short man page; navigate with arrows, Enter, and q to quit

/usr/share/doc/ holds packaged documentation (README, HTML, examples) installed with software on many distributions

locate searches a prebuilt filename database for path matches and is typically faster than a full filesystem find for name lookups

Last updated: July 2026

When you forget a switch or meet an unfamiliar command, Linux expects you to help yourself from the terminal . Objective 2.2 covers the classic help stack: man , info , files under /usr/share/doc/ , and locate for finding documentation or other files by name.

  • man : The System Manual man ls
  • man 5 passwd
  • man man

man formats a manual page and sends it to a pager (commonly less ). Essential pager keys:

  • Key Action
  • Space / f Next page
  • b Previous page
  • Arrow keys / j k Line movement
  • /pattern Search forward for pattern
  • n Next search hit
  • q Quit back to the shell

A typical man page includes NAME , SYNOPSIS , DESCRIPTION , OPTIONS , and sometimes EXAMPLES or SEE ALSO . Read the SYNOPSIS carefully: square brackets mean optional items; | separates alternatives; ellipses ... mean “more of the same.”

Manual Sections

Pages are stored in numbered sections . The same name can exist in more than one section (classic example: passwd ).

  • Section Contents Example
  • 1 Executable user commands man 1 ls
  • 2 System calls man 2 open
  • 3 Library functions man 3 printf
  • 4 Special files (devices) man 4 null
  • 5 File formats and conventions man 5 passwd
  • 6 Games (rarely needed)
  • 7 Miscellany (protocols, standards) man 7 man
  • 8 System administration commands man 8 useradd

For Essentials, prioritize 1 , 5 , and 8 . If man passwd shows the command instead of /etc/passwd ’s format, request the section explicitly: man 5 passwd . whatis ls # one-line summary from the whatis database

man -k copy # approximate keyword search (same idea as apropos)

man -k / apropos search short descriptions — useful when you remember what you want but not the command name.

  • info : Hyperlinked Texinfo Manuals
  • GNU projects often ship richer documentation as Info documents: info ls
  • info coreutils
  • info bash

Info readers present a menu of nodes. Common navigation:

  • Action Typical key
  • Follow a menu item Enter on the link
  • Next / previous node n / p (in many info readers)
  • Up to parent menu u
  • Quit q
  • Search s then pattern

Compared with man , info manuals may include tutorials and deeper cross-links. If man feels too terse, try info for the same topic. Not every command has an Info document; when none exists, the reader says so and you fall back to man or /usr/share/doc/ .

  • /usr/share/doc/ : Packaged Documentation
  • Distributions install per-package documents under /usr/share/doc/ : ls /usr/share/doc/
  • ls /usr/share/doc/bash/
  • less /usr/share/doc/bash/README

You often find README , changelog , copyright , example configs, and HTML manuals. This tree is ideal when:

You need examples or packaging notes not in the man page.

A package ships a long HOWTO only as a file.

You are browsing offline on a minimal server.

Remember the path itself — fill-in questions may ask where additional documentation is stored, and /usr/share/doc/ is the expected answer.

  • locate : Fast Name Search locate passwd
  • locate '*.desktop'
  • locate README | head

locate queries a prebuilt database of file paths (updated by a periodic job such as updatedb ). Strengths and caveats:

  • Aspect Behavior
  • Speed Usually much faster than walking the whole disk with find
  • Freshness May miss brand-new files until the database is refreshed
  • Scope Matches path substrings; use patterns carefully
  • Privilege Database may omit directories the indexing user could not read

For objective 2.2, use locate to find documentation files or command paths by name . Example workflow: locate bash | grep '/usr/share/doc'

# narrow results to documentation paths

Do not confuse locate with which / type (command resolution) or with man -k (description search). Each tool answers a different question.

When to Use Which Helper

  • Need Start with
  • Exact options for a known command man command
  • File format of a config (e.g. passwd structure) man 5 name
  • Broader GNU tutorial / linked chapters info topic
  • README / examples shipped with a package Browse /usr/share/doc/package/
  • “Where is that file?” by name locate pattern
  • “What command mentions backup?” man -k backup or apropos backup
  • Worked Scenario

You need the meaning of chmod ’s symbolic mode and also want the package’s README: man 1 chmod # read OPTIONS and examples; q to quit

  • info coreutils # optional deeper GNU docs if installed
  • ls /usr/share/doc/coreutils/
  • locate 'chmod*'

If man chmod opens but you cannot leave, you forgot q . That navigation detail appears in training materials because new users often feel “stuck” inside the pager.

  • One-Line Summaries and Keyword Search
  • Before opening a full page, you can ask the whatis database for a short description: whatis printf
  • apropos editor
  • man -k permission

whatis (and the related man -f ) expects a name and returns a concise summary. apropos / man -k search those summaries for a keyword, which helps when you remember the task (“compress”, “calendar”, “password”) but not the utility. If the database was never built on a minimal install, these helpers may return nothing until the administrator generates the index — another reminder that help tools depend on local documentation packages being present.

Sometimes the same name exists in multiple sections. man -a passwd walks through every matching page so you can compare the command (section 1) with the file format (section 5). On a timed exam item, naming the section explicitly is faster and clearer than paging through every hit.

Choosing Help Under Time Pressure

Walk a decision path the way you will on test day:

You know the command name and need flags → start with man command (section 1 by default).

You know a config file name and need field meanings → try man 5 name or look under /usr/share/doc/ for examples.

The man page is too short or points you to a Texinfo manual → run info on the same topic.

You do not know where a README or example file lives → locate a distinctive fragment of the path or filename, then open it with less .

You only remember a verb (“schedule”, “archive”) → man -k / apropos to discover candidate commands, then read their man pages.

That sequence keeps you from randomly mixing tools. locate will not explain options; man will not search the whole disk for a misplaced example script; /usr/share/doc/ will not refresh itself when you invent a new file in /tmp .

locate Freshness and Permissions

Because locate reads a database (commonly maintained by updatedb via cron or a systemd timer), results can lag. A file you created moments ago may be invisible until the next update. Conversely, a deleted file might still appear until the database is rebuilt. If a locate search surprises you, consider freshness before assuming the file never existed.

Permissions also matter: paths the indexer could not read may be absent from the database. For Essentials, remember the design goal — fast name lookup from an index — and contrast it with a live recursive search that walks directories in real time (deeper find skills show up more in later objectives).

Exam Tips

Match the tool to the job: man for reference pages, info for Texinfo manuals, /usr/share/doc/ for packaged files, locate for path search.

Know section numbers at least for 1 (commands) and 5 (file formats).

Know q exits the man/info pager; / searches inside less .

locate depends on its database — a missing recent file is not always a failure of the command itself.

Prefer man -k / apropos when you have a keyword but not a command name; prefer whatis when you already have the name and want a one-line reminder.

With these helpers, you can answer “what does this switch do?” without leaving the command line — exactly the skill Linux Essentials weights in Topic 2.