Skip to content

Bash-Oneliner

A personal collection of handy Bash one-liners and terminal tricks for data work and Linux upkeep.

Stars
10.8k
Forks
646
Licence
MIT
Language
—
Last update
2 months ago
Type
Curated list

What it is

This is a reference collection of short command-line snippets and keyboard shortcuts for Bash, grouped by topic such as grep, sed, awk, xargs, variables, and system maintenance. The author gathered them from work, bioinformatics and cloud computing, and an LPIC exam, and says many came from search engines and Stack Overflow. It is a notes-style guide rather than a software tool you install.

  • Look up a Ctrl-key shortcut to edit a long command line faster
  • Use history expansion like !! or sudo !! to rerun a previous command
  • Find a grep, sed, or awk snippet for processing a text file
  • Learn tmux or GNU screen commands for managing multiple terminal sessions
  • Check environment variables such as $PATH or $EDITOR

Great for

  • Linux users who want quick reminders of shell shortcuts and history tricks
  • Beginners learning Bash variables, globbing, and history expansion
  • Sysadmins looking for short recipes for text processing and system checks
  • Students preparing for Linux certification topics

Not ideal for

  • Readers who need detailed explanations or citations, since the author says most commands lack citations
  • Anyone on Windows without a Bash environment, because the commands target Linux and macOS shells
  • Users needing tested, production-grade scripts, since the author notes commands may not work on every system
Step-by-step guide: how to use Bash-OnelinerInstall, first run, examples, tips and FAQs

How to get it

  1. 1

    Read it online

    Clone the repository

    git clone https://github.com/onceupon/Bash-Oneliner
  2. 2

    Run it

    • Open the project page at https://github.com/onceupon/Bash-Oneliner or the homepage linked in the repo
    • Scroll to a topic such as Terminal Tricks, Variable, or Grep
    • Copy a command and run it in a Bash terminal, checking the output first
    • Try the Ctrl-key shortcuts in your terminal to see how each one behaves
  3. 3

    Get the most out of it

    • Try the vi-mode section to use vi-style editing keys at the Bash prompt
    • Use the tmux section to split panes and synchronize input across panes
    • Use the Ctrl+x Ctrl+e shortcut to edit long multi-line commands in your editor
    • Read the man page for readline when you want the full key mapping

Downloads

Strengths

  • Covers many practical shell shortcuts in one place
  • Examples show the command and its expected output in plain text
  • Released under the MIT license, so it can be reused freely

Trade-offs

  • The author states the commands were tested only on certain distributions and may not work elsewhere
  • Many examples lack detailed explanations or sources
  • The README is written by a non-native English speaker and some wording is unclear

How it compares

ProjectStarsTypeLevelUpdatedBest for
Bash-Oneliner (this)10.8kCurated listbeginner2 months agoLinux users who want quick reminders of shell shortcuts and history tricks
inshellisense10.8kDev toolbeginner7 days agoDevelopers who spend a lot of time in the terminal and want suggestions for unfamiliar command options
awesome-cheatsheets12.6kCurated listbeginner2 months agoChinese-speaking developers who want quick command or syntax reminders
linux-command37.2kLearning resourcebeginner6 days agoPeople learning the Linux command line who want quick, readable command explanations
dockerfiles13.9kCurated listintermediate2.3 years agoDevelopers who want working examples of Dockerfiles for desktop applications run in containers
hyper44.8kAppbeginner3 months agoDevelopers who want a terminal they can customize with extensions or themes

Stats synced from GitHub. The assessment above was drafted with AI from the project's README on 2026-10-29 and may miss recent changes — check the README before relying on a command. MIT licence: free to use, modify and distribute, including commercially, as long as you keep the copyright notice.