-
-
Notifications
You must be signed in to change notification settings - Fork 2
Linux history Guide
Mattscreative edited this page Dec 5, 2025
·
2 revisions
Complete beginner-friendly guide to history on Linux, covering Arch Linux, CachyOS, and other distributions including command history, history navigation, and history management.
history shows command history.
Uses:
- View history: See past commands
- Reuse commands: Run previous commands
- Search history: Find past commands
- History management: Manage command history
Why it matters:
- Productivity: Reuse commands quickly
- Learning: See what you did
- Efficiency: Save typing
Basic usage:
# Show history
history
# Shows numbered listRecent history:
# Last 10 commands
history 10
# Or
history | tail -10Find commands:
# Search history
history | grep command
# Or use Ctrl+R
# Press Ctrl+R, type search termExecute by number:
# Run command by number
!42
# Executes command #42Delete history:
# Clear current session
history -c
# Or clear file
> ~/.bash_historyConfigure size:
# In ~/.bashrc
HISTSIZE=10000
HISTFILESIZE=20000Check config:
# Verify history file
ls -la ~/.bash_history
# Check HISTSIZE
echo $HISTSIZEThis guide covered history usage, command history, and history management for Arch Linux, CachyOS, and other distributions.
- Shell Configuration - Shell setup
- Bash Scripting Guide - Scripting
-
history Documentation:
man history
This guide covers Arch Linux, CachyOS, and other Linux distributions. For distribution-specific details, refer to your distribution's documentation.