A unified Linux documentation lookup tool that consolidates help information from multiple sources into a single, easy-to-use interface.
rtfm
solves the common problem of fragmented documentation by searching across all available help systems and presenting the results in one place. Instead of remembering whether to use man
, info
, help
, or tldr
, just use rtfm
.
- Multi-source documentation search in order:
- Bash builtin help
- Man pages (from all directories in
manpath
) - Info pages
- TLDR pages (simplified examples)
- Command --help (for scripts without formal documentation)
- Smart fallback: Automatically detects and runs
--help
for text-based scripts - Fast lookups: Pre-built indices enable O(1) performance
- Update detection: Warns when new man pages are installed
- Secure updates: SHA256 checksum verification
- Enhanced formatting: Optional markdown rendering with
md2ansi
- Clean pagination: Integrated with
less
for easy navigation
# One-liner installation
wget https://raw.githubusercontent.com/Open-Technology-Foundation/rtfm/main/rtfm && chmod +x rtfm && sudo ./rtfm --install
# Download the script
wget https://raw.githubusercontent.com/Open-Technology-Foundation/rtfm/main/rtfm
# Make it executable
chmod +x rtfm
# Install rtfm and dependencies
sudo ./rtfm --install
This installs:
rtfm
to/usr/local/share/rtfm/
with symlink in/usr/local/bin/
md2ansi
for enhanced markdown formattingtldr
pages for simplified command examples- Pre-generated documentation indices for your system
rtfm <command>
# Look up rsync documentation (finds man page + tldr examples)
rtfm rsync
# Get help for bash's declare builtin
rtfm declare
# View comprehensive GNU coreutils documentation
rtfm coreutils
# Find all documentation for the find command
rtfm find
# Get help for a custom script (fallback to --help)
rtfm my-script
# Update rtfm and all dependencies
sudo rtfm --update
# Rebuild documentation indices after installing new packages
sudo rtfm --rebuild-lists
# Display help
rtfm --help
-r, --rebuild-lists
: Rebuild command lists from documentation sources--install, --update
: Install or update rtfm and dependencies-v, --verbose
: Verbose output (default)-q, --quiet
: Suppress verbose messages-V, --version
: Display version information-h, --help
: Show help message
rtfm searches these locations in order:
-
Bash Builtins (
/usr/local/share/rtfm/builtin.list
)- Generated from
compgen -b
- Covers commands like
cd
,alias
,declare
, etc.
- Generated from
-
Man Pages (
/usr/local/share/rtfm/man.list
)- Searches all directories from
manpath
- Includes both compressed (.gz) and uncompressed pages
- Automatically detects new installations
- Searches all directories from
-
Info Pages (
/usr/local/share/rtfm/info.list
)- GNU project documentation
- Often more detailed than man pages
-
TLDR Pages (
/usr/local/share/rtfm/tldr.list
)- Community-maintained simplified examples
- Great for quick command usage references
-
Command --help (fallback)
- For executable scripts without formal documentation
- Detects if script contains
--help
option - Only runs if script is a text file (not binary)
rtfm monitors man page directories and warns when new pages are installed:
rtfm: Warning: New man pages detected. Run 'sudo rtfm --rebuild-lists' to update the index.
This ensures your documentation index stays current without manual intervention.
- Input validation: Prevents command injection with strict character whitelisting
- SHA256 checksums: Verifies integrity of downloaded files
- Automatic rollback: Restores previous version if update fails
- Privilege checks: Uses
can_sudo
to verify permissions before system changes
- Executable:
/usr/local/bin/rtfm
(symlink to/usr/local/share/rtfm/rtfm
) - Documentation indices:
/usr/local/share/rtfm/*.list
- TLDR pages:
/usr/local/share/tldr/
- md2ansi:
/usr/local/share/md2ansi/
- bash: Script execution environment
- grep: Searching through lists
- less: Paginated viewing
- man: Man page system
- info: GNU info system
- git: For installation/updates
- tldr: Simplified command examples
- md2ansi: Enhanced markdown formatting
- sha256sum: Checksum verification (recommended)
- file: For detecting script types in --help fallback
# Rebuild the documentation indices
sudo rtfm --rebuild-lists
# Check if you have sudo access
groups | grep -E 'sudo|admin|wheel'
# Install git manually if needed
sudo apt-get install git
# Install sha256sum for security
sudo apt-get install coreutils
# Or skip verification (not recommended)
# The installer will warn but continue
- Fork the repository
- Make your changes
- Run
./update-checksums.sh
before committing - Submit a pull request
GNU General Public License v3.0 - see LICENSE for details.