|
<!DOCTYPE html> |
|
<html lang="en"> |
|
<head> |
|
<meta charset="UTF-8"> |
|
<meta name="viewport" content="width=device-width, initial-scale=1.0"> |
|
<title>Linux Shell Commands Reference</title> |
|
<link href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;600;700&family=Syne:wght@700;800&display=swap" rel="stylesheet"> |
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/tippy.js/6.3.7/tippy.min.css"> |
|
<style> |
|
:root { |
|
--bg: #0a0c10; |
|
--surface: #111419; |
|
--border: #1e2330; |
|
--glow-base: 0 0 12px; |
|
|
|
--c1: #00e5ff; |
|
--c2: #69ff47; |
|
--c3: #ff6b6b; |
|
--c4: #ffd166; |
|
--c5: #b388ff; |
|
--c6: #ff9a3c; |
|
--c7: #4dd0e1; |
|
--c8: #f06292; |
|
} |
|
|
|
* { box-sizing: border-box; margin: 0; padding: 0; } |
|
|
|
body { |
|
background: var(--bg); |
|
font-family: 'JetBrains Mono', monospace; |
|
color: #c9d1d9; |
|
min-height: 100vh; |
|
padding: 32px 28px 40px; |
|
background-image: |
|
repeating-linear-gradient(0deg, transparent, transparent 39px, rgba(255,255,255,.015) 39px, rgba(255,255,255,.015) 40px), |
|
repeating-linear-gradient(90deg, transparent, transparent 39px, rgba(255,255,255,.015) 39px, rgba(255,255,255,.015) 40px); |
|
} |
|
|
|
header { |
|
text-align: center; |
|
margin-bottom: 36px; |
|
} |
|
|
|
header h1 { |
|
font-family: 'Syne', sans-serif; |
|
font-size: clamp(1.8rem, 4vw, 3rem); |
|
font-weight: 800; |
|
letter-spacing: .08em; |
|
text-transform: uppercase; |
|
background: linear-gradient(90deg, var(--c1), var(--c2), var(--c5), var(--c3)); |
|
-webkit-background-clip: text; |
|
-webkit-text-fill-color: transparent; |
|
background-clip: text; |
|
} |
|
|
|
header p { |
|
margin-top: 6px; |
|
font-size: .75rem; |
|
color: #4a5568; |
|
letter-spacing: .15em; |
|
text-transform: uppercase; |
|
} |
|
|
|
.grid { |
|
display: grid; |
|
grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); |
|
gap: 14px; |
|
} |
|
|
|
.card { |
|
background: var(--surface); |
|
border: 1px solid var(--border); |
|
border-radius: 8px; |
|
padding: 14px 14px 16px; |
|
position: relative; |
|
overflow: hidden; |
|
transition: transform .18s ease, border-color .18s ease; |
|
} |
|
|
|
.card:hover { transform: translateY(-2px); } |
|
|
|
.card::before { |
|
content: ''; |
|
position: absolute; |
|
inset: 0 0 auto 0; |
|
height: 3px; |
|
border-radius: 8px 8px 0 0; |
|
} |
|
|
|
.c1::before { background: var(--c1); } |
|
.c2::before { background: var(--c2); } |
|
.c3::before { background: var(--c3); } |
|
.c4::before { background: var(--c4); } |
|
.c5::before { background: var(--c5); } |
|
.c6::before { background: var(--c6); } |
|
.c7::before { background: var(--c7); } |
|
.c8::before { background: var(--c8); } |
|
|
|
.c1:hover { border-color: var(--c1); box-shadow: var(--glow-base) rgba(0,229,255,.18); } |
|
.c2:hover { border-color: var(--c2); box-shadow: var(--glow-base) rgba(105,255,71,.18); } |
|
.c3:hover { border-color: var(--c3); box-shadow: var(--glow-base) rgba(255,107,107,.18); } |
|
.c4:hover { border-color: var(--c4); box-shadow: var(--glow-base) rgba(255,209,102,.18); } |
|
.c5:hover { border-color: var(--c5); box-shadow: var(--glow-base) rgba(179,136,255,.18); } |
|
.c6:hover { border-color: var(--c6); box-shadow: var(--glow-base) rgba(255,154,60,.18); } |
|
.c7:hover { border-color: var(--c7); box-shadow: var(--glow-base) rgba(77,208,225,.18); } |
|
.c8:hover { border-color: var(--c8); box-shadow: var(--glow-base) rgba(240,98,146,.18); } |
|
|
|
.card-title { |
|
font-family: 'Syne', sans-serif; |
|
font-size: .7rem; |
|
font-weight: 700; |
|
letter-spacing: .18em; |
|
text-transform: uppercase; |
|
margin-bottom: 12px; |
|
padding-bottom: 8px; |
|
border-bottom: 1px solid var(--border); |
|
} |
|
|
|
.c1 .card-title { color: var(--c1); } |
|
.c2 .card-title { color: var(--c2); } |
|
.c3 .card-title { color: var(--c3); } |
|
.c4 .card-title { color: var(--c4); } |
|
.c5 .card-title { color: var(--c5); } |
|
.c6 .card-title { color: var(--c6); } |
|
.c7 .card-title { color: var(--c7); } |
|
.c8 .card-title { color: var(--c8); } |
|
|
|
.chips { |
|
display: flex; |
|
flex-wrap: wrap; |
|
gap: 6px; |
|
} |
|
|
|
.chip { |
|
display: inline-block; |
|
font-size: .72rem; |
|
font-weight: 600; |
|
padding: 3px 9px; |
|
border-radius: 4px; |
|
border: 1px solid transparent; |
|
white-space: nowrap; |
|
transition: background .15s, box-shadow .15s; |
|
cursor: default; |
|
} |
|
|
|
.c1 .chip { background: rgba(0,229,255,.08); border-color: rgba(0,229,255,.25); color: #a0f0ff; } |
|
.c2 .chip { background: rgba(105,255,71,.08); border-color: rgba(105,255,71,.25); color: #b6ffaa; } |
|
.c3 .chip { background: rgba(255,107,107,.08);border-color: rgba(255,107,107,.25);color: #ffb3b3; } |
|
.c4 .chip { background: rgba(255,209,102,.08);border-color: rgba(255,209,102,.25);color: #ffe8a0; } |
|
.c5 .chip { background: rgba(179,136,255,.08);border-color: rgba(179,136,255,.25);color: #d5bfff; } |
|
.c6 .chip { background: rgba(255,154,60,.08); border-color: rgba(255,154,60,.25); color: #ffd0a0; } |
|
.c7 .chip { background: rgba(77,208,225,.08); border-color: rgba(77,208,225,.25); color: #aaeef5; } |
|
.c8 .chip { background: rgba(240,98,146,.08); border-color: rgba(240,98,146,.25); color: #ffb8d0; } |
|
|
|
.c1 .chip:hover { background: rgba(0,229,255,.18); box-shadow: 0 0 8px rgba(0,229,255,.3); } |
|
.c2 .chip:hover { background: rgba(105,255,71,.18); box-shadow: 0 0 8px rgba(105,255,71,.3); } |
|
.c3 .chip:hover { background: rgba(255,107,107,.18);box-shadow: 0 0 8px rgba(255,107,107,.3); } |
|
.c4 .chip:hover { background: rgba(255,209,102,.18);box-shadow: 0 0 8px rgba(255,209,102,.3); } |
|
.c5 .chip:hover { background: rgba(179,136,255,.18);box-shadow: 0 0 8px rgba(179,136,255,.3); } |
|
.c6 .chip:hover { background: rgba(255,154,60,.18); box-shadow: 0 0 8px rgba(255,154,60,.3); } |
|
.c7 .chip:hover { background: rgba(77,208,225,.18); box-shadow: 0 0 8px rgba(77,208,225,.3); } |
|
.c8 .chip:hover { background: rgba(240,98,146,.18); box-shadow: 0 0 8px rgba(240,98,146,.3); } |
|
|
|
@media (min-width: 800px) { |
|
.wide { grid-column: span 2; } |
|
} |
|
|
|
footer { |
|
text-align: center; |
|
margin-top: 32px; |
|
font-size: .65rem; |
|
color: #2d3748; |
|
letter-spacing: .12em; |
|
text-transform: uppercase; |
|
} |
|
|
|
/* ── Tippy custom theme ── */ |
|
.tippy-box[data-theme~='terminal'] { |
|
background: #0d1117; |
|
border: 1px solid #30363d; |
|
border-radius: 6px; |
|
box-shadow: 0 8px 24px rgba(0,0,0,.6); |
|
font-family: 'JetBrains Mono', monospace; |
|
font-size: .72rem; |
|
max-width: 280px; |
|
padding: 0; |
|
} |
|
.tippy-box[data-theme~='terminal'] .tippy-content { padding: 0; } |
|
.tippy-box[data-theme~='terminal'] .tippy-arrow { color: #30363d; } |
|
|
|
.tt { |
|
padding: 9px 11px 10px; |
|
line-height: 1.55; |
|
border-radius: 6px; |
|
border-top: 2px solid transparent; |
|
} |
|
.tt-cmd { font-weight: 700; font-size: .78rem; margin-bottom: 4px; letter-spacing: .03em; } |
|
.tt-desc { color: #8b949e; font-size: .69rem; line-height: 1.5; } |
|
.tt-example { |
|
margin-top: 7px; |
|
background: #161b22; |
|
border: 1px solid #21262d; |
|
border-radius: 4px; |
|
padding: 4px 8px; |
|
color: #c9d1d9; |
|
font-size: .67rem; |
|
white-space: pre; |
|
} |
|
|
|
.tt.a1 { border-top-color: var(--c1); } .tt.a1 .tt-cmd { color: var(--c1); } |
|
.tt.a2 { border-top-color: var(--c2); } .tt.a2 .tt-cmd { color: var(--c2); } |
|
.tt.a3 { border-top-color: var(--c3); } .tt.a3 .tt-cmd { color: var(--c3); } |
|
.tt.a4 { border-top-color: var(--c4); } .tt.a4 .tt-cmd { color: var(--c4); } |
|
.tt.a5 { border-top-color: var(--c5); } .tt.a5 .tt-cmd { color: var(--c5); } |
|
.tt.a6 { border-top-color: var(--c6); } .tt.a6 .tt-cmd { color: var(--c6); } |
|
.tt.a7 { border-top-color: var(--c7); } .tt.a7 .tt-cmd { color: var(--c7); } |
|
.tt.a8 { border-top-color: var(--c8); } .tt.a8 .tt-cmd { color: var(--c8); } |
|
</style> |
|
</head> |
|
<body> |
|
|
|
<header> |
|
<h1>Linux Shell Commands</h1> |
|
<p>Quick Reference · Shell Proficiency · Hover any command for details</p> |
|
</header> |
|
|
|
<div class="grid"> |
|
|
|
<!-- Manual Lookup --> |
|
<div class="card c1"> |
|
<div class="card-title">Manual Lookup</div> |
|
<div class="chips"> |
|
<span class="chip" data-tippy-content='<div class="tt a1"><div class="tt-cmd">man</div><div class="tt-desc">Show the manual for a command. Press <strong>q</strong> to quit; spacebar / arrows to scroll.</div><div class="tt-example">man ls</div></div>'>man</span> |
|
<span class="chip" data-tippy-content='<div class="tt a1"><div class="tt-cmd"><cmd> -h</div><div class="tt-desc">Show help or usage info for a command (most tools support this flag).</div><div class="tt-example">grep -h</div></div>'><cmd> -h</span> |
|
<span class="chip" data-tippy-content='<div class="tt a1"><div class="tt-cmd"><cmd> -?</div><div class="tt-desc">Alternative help flag — behaviour varies by tool.</div><div class="tt-example">find -?</div></div>'><cmd> -?</span> |
|
</div> |
|
</div> |
|
|
|
<!-- Wildcards --> |
|
<div class="card c4"> |
|
<div class="card-title">Wildcards</div> |
|
<div class="chips"> |
|
<span class="chip" data-tippy-content='<div class="tt a4"><div class="tt-cmd">abc*</div><div class="tt-desc">Glob — match anything starting with "abc": abcd, abcXYZ, etc.</div><div class="tt-example">ls report_*.csv</div></div>'>abc*</span> |
|
<span class="chip" data-tippy-content='<div class="tt a4"><div class="tt-cmd">"ab c"</div><div class="tt-desc">Double quotes preserve spaces in a name. Variables and special chars still expand inside.</div><div class="tt-example">cd "my folder"</div></div>'>"ab c"</span> |
|
<span class="chip" data-tippy-content='<div class="tt a4"><div class="tt-cmd">'ab c'</div><div class="tt-desc">Single quotes preserve spaces AND treat everything as literal — no variable expansion.</div><div class="tt-example">echo '$PATH is literal'</div></div>'>'ab c'</span> |
|
</div> |
|
</div> |
|
|
|
<!-- Listing & Navigation --> |
|
<div class="card c2 wide"> |
|
<div class="card-title">Listing & Navigation</div> |
|
<div class="chips"> |
|
<span class="chip" data-tippy-content='<div class="tt a2"><div class="tt-cmd">ls</div><div class="tt-desc">List files in the current directory. Like <strong>dir</strong> in Windows. Add <strong>-la</strong> for full detail.</div><div class="tt-example">ls -la /etc</div></div>'>ls</span> |
|
<span class="chip" data-tippy-content='<div class="tt a2"><div class="tt-cmd">ll</div><div class="tt-desc">Alias for <strong>ls -l</strong> — detailed view with permissions, owner, size, and timestamp.</div><div class="tt-example">ll /var/log</div></div>'>ll</span> |
|
<span class="chip" data-tippy-content='<div class="tt a2"><div class="tt-cmd">tree</div><div class="tt-desc">Print all files and directories as an indented tree. Use <strong>-L</strong> to limit depth.</div><div class="tt-example">tree -L 2</div></div>'>tree</span> |
|
<span class="chip" data-tippy-content='<div class="tt a2"><div class="tt-cmd">../</div><div class="tt-desc">Parent directory — one level up. Chain them: <strong>../../</strong> goes up two levels.</div><div class="tt-example">cd ../../etc</div></div>'>../</span> |
|
<span class="chip" data-tippy-content='<div class="tt a2"><div class="tt-cmd">./</div><div class="tt-desc">Current directory. Required when running scripts or binaries here (not in $PATH).</div><div class="tt-example">./build.sh</div></div>'>./</span> |
|
<span class="chip" data-tippy-content='<div class="tt a2"><div class="tt-cmd">/</div><div class="tt-desc">Filesystem root — the top of the entire directory tree. Like <strong>C:\</strong> in Windows.</div><div class="tt-example">ls /</div></div>'>/</span> |
|
<span class="chip" data-tippy-content='<div class="tt a2"><div class="tt-cmd">pwd</div><div class="tt-desc">Print Working Directory — show the full absolute path of where you are right now.</div><div class="tt-example">pwd</div></div>'>pwd</span> |
|
<span class="chip" data-tippy-content='<div class="tt a2"><div class="tt-cmd">cd</div><div class="tt-desc">Change directory. With no argument, returns to your home directory.</div><div class="tt-example">cd /var/log</div></div>'>cd</span> |
|
<span class="chip" data-tippy-content='<div class="tt a2"><div class="tt-cmd">~</div><div class="tt-desc">Shorthand for your home directory (e.g. <strong>/home/alice</strong>). Use anywhere in a path.</div><div class="tt-example">cd ~/Documents</div></div>'>~</span> |
|
<span class="chip" data-tippy-content='<div class="tt a2"><div class="tt-cmd"><Tab></div><div class="tt-desc">Auto-complete a partially typed filename or command. One press to complete; two to list options.</div></div>'><tab></span> |
|
<span class="chip" data-tippy-content='<div class="tt a2"><div class="tt-cmd"><Tab><Tab></div><div class="tt-desc">List all completions that match the prefix you have typed so far.</div></div>'><tab><tab></span> |
|
</div> |
|
</div> |
|
|
|
<!-- Viewing Text --> |
|
<div class="card c4 wide"> |
|
<div class="card-title">Viewing Text</div> |
|
<div class="chips"> |
|
<span class="chip" data-tippy-content='<div class="tt a4"><div class="tt-cmd">cat</div><div class="tt-desc">Dump an entire file to stdout. Best for small files; use <strong>less</strong> for large ones.</div><div class="tt-example">cat /etc/hosts</div></div>'>cat</span> |
|
<span class="chip" data-tippy-content='<div class="tt a4"><div class="tt-cmd">less</div><div class="tt-desc">Scroll up and down through a file. Press <strong>q</strong> to quit, <strong>/</strong> to search forward.</div><div class="tt-example">less /var/log/syslog</div></div>'>less</span> |
|
<span class="chip" data-tippy-content='<div class="tt a4"><div class="tt-cmd">more</div><div class="tt-desc">Page through a file downward only — the older predecessor to <strong>less</strong>.</div><div class="tt-example">more bigfile.txt</div></div>'>more</span> |
|
<span class="chip" data-tippy-content='<div class="tt a4"><div class="tt-cmd">most</div><div class="tt-desc">Like <strong>less</strong> but also scrolls left and right — handy for very wide output.</div><div class="tt-example">most wide.log</div></div>'>most</span> |
|
<span class="chip" data-tippy-content='<div class="tt a4"><div class="tt-cmd">head</div><div class="tt-desc">Print the first 10 lines of a file. Change the count with <strong>-n</strong>.</div><div class="tt-example">head -n 20 file.txt</div></div>'>head</span> |
|
<span class="chip" data-tippy-content='<div class="tt a4"><div class="tt-cmd">tail</div><div class="tt-desc">Print the last 10 lines. Use <strong>-f</strong> to follow a live log in real time.</div><div class="tt-example">tail -f /var/log/syslog</div></div>'>tail</span> |
|
<span class="chip" data-tippy-content='<div class="tt a4"><div class="tt-cmd">|</div><div class="tt-desc">Pipe — connect two commands: left command's stdout becomes right command's stdin.</div><div class="tt-example">ls -la | grep ".log"</div></div>'>|</span> |
|
<span class="chip" data-tippy-content='<div class="tt a4"><div class="tt-cmd">echo</div><div class="tt-desc">Print a string to stdout. Commonly used in scripts to display messages or variable values.</div><div class="tt-example">echo $HOME</div></div>'>echo</span> |
|
<span class="chip" data-tippy-content='<div class="tt a4"><div class="tt-cmd">clear</div><div class="tt-desc">Clear the terminal screen. Shortcut: <strong>Ctrl+L</strong>.</div><div class="tt-example">clear</div></div>'>clear</span> |
|
<span class="chip" data-tippy-content='<div class="tt a4"><div class="tt-cmd"><Shift><PgUp></div><div class="tt-desc">Scroll the terminal's scrollback buffer upward to review previous output.</div></div>'><Shift><PgUp></span> |
|
<span class="chip" data-tippy-content='<div class="tt a4"><div class="tt-cmd">resize</div><div class="tt-desc">Resync the shell's idea of column/row width after resizing the terminal window — fixes garbled wrapping.</div><div class="tt-example">resize</div></div>'>resize</span> |
|
</div> |
|
</div> |
|
|
|
<!-- Text Editors --> |
|
<div class="card c5"> |
|
<div class="card-title">Text Editors</div> |
|
<div class="chips"> |
|
<span class="chip" data-tippy-content='<div class="tt a5"><div class="tt-cmd">nano</div><div class="tt-desc">Beginner-friendly terminal editor. <strong>Ctrl+O</strong> to save, <strong>Ctrl+X</strong> to exit. Key hints shown at the bottom.</div><div class="tt-example">nano config.txt</div></div>'>nano</span> |
|
<span class="chip" data-tippy-content='<div class="tt a5"><div class="tt-cmd">vi</div><div class="tt-desc">Classic modal terminal editor. Press <strong>i</strong> to insert text, <strong>ESC</strong> to return to command mode.</div><div class="tt-example">vi notes.txt</div></div>'>vi</span> |
|
<span class="chip" data-tippy-content='<div class="tt a5"><div class="tt-cmd">vim</div><div class="tt-desc">Improved vi. Navigate with <strong>hjkl</strong>. Save and quit with <strong>:wq</strong>; quit without saving: <strong>:q!</strong></div><div class="tt-example">vim script.sh</div></div>'>vim</span> |
|
<span class="chip" data-tippy-content='<div class="tt a5"><div class="tt-cmd">emacs</div><div class="tt-desc">Powerful terminal editor. Uses <strong>C-x C-s</strong> to save, <strong>C-x C-c</strong> to quit.</div><div class="tt-example">emacs notes.txt</div></div>'>emacs</span> |
|
<span class="chip" data-tippy-content='<div class="tt a5"><div class="tt-cmd">gedit</div><div class="tt-desc">GNOME graphical text editor with syntax highlighting. Requires a desktop session.</div><div class="tt-example">gedit file.txt &</div></div>'>gedit</span> |
|
<span class="chip" data-tippy-content='<div class="tt a5"><div class="tt-cmd">kate</div><div class="tt-desc">KDE graphical editor with split-view and a built-in terminal panel.</div><div class="tt-example">kate file.txt &</div></div>'>kate</span> |
|
<span class="chip" data-tippy-content='<div class="tt a5"><div class="tt-cmd">gvim</div><div class="tt-desc">Graphical Vim — all the power of vim with a windowed GUI and menu bar.</div><div class="tt-example">gvim script.py &</div></div>'>gvim</span> |
|
<span class="chip" data-tippy-content='<div class="tt a5"><div class="tt-cmd">xemacs</div><div class="tt-desc">Graphical fork of Emacs with an X11 window, menus, and toolbar.</div><div class="tt-example">xemacs notes.txt &</div></div>'>xemacs</span> |
|
</div> |
|
</div> |
|
|
|
<!-- Creating/Deleting Files --> |
|
<div class="card c3 wide"> |
|
<div class="card-title">Creating & Deleting Files</div> |
|
<div class="chips"> |
|
<span class="chip" data-tippy-content='<div class="tt a3"><div class="tt-cmd">touch</div><div class="tt-desc">Create an empty file, or update the access/modification timestamp on an existing one.</div><div class="tt-example">touch newfile.txt</div></div>'>touch</span> |
|
<span class="chip" data-tippy-content='<div class="tt a3"><div class="tt-cmd">></div><div class="tt-desc">Redirect stdout to a file, <strong>overwriting</strong> it. Creates the file if it does not exist.</div><div class="tt-example">echo "hello" > out.txt</div></div>'>></span> |
|
<span class="chip" data-tippy-content='<div class="tt a3"><div class="tt-cmd">>></div><div class="tt-desc">Redirect stdout and <strong>append</strong> to a file — existing content is preserved.</div><div class="tt-example">echo "line" >> log.txt</div></div>'>>></span> |
|
<span class="chip" data-tippy-content='<div class="tt a3"><div class="tt-cmd">mkdir</div><div class="tt-desc">Create a new directory. Use <strong>-p</strong> to create nested parent directories in one step.</div><div class="tt-example">mkdir -p a/b/c</div></div>'>mkdir</span> |
|
<span class="chip" data-tippy-content='<div class="tt a3"><div class="tt-cmd">cp</div><div class="tt-desc">Copy a file or directory. Use <strong>-r</strong> to copy directories recursively.</div><div class="tt-example">cp -r src/ dest/</div></div>'>cp</span> |
|
<span class="chip" data-tippy-content='<div class="tt a3"><div class="tt-cmd">mv</div><div class="tt-desc">Move or rename a file or directory. Works across directories too.</div><div class="tt-example">mv old.txt new.txt</div></div>'>mv</span> |
|
<span class="chip" data-tippy-content='<div class="tt a3"><div class="tt-cmd">scp</div><div class="tt-desc">Securely copy files between hosts over SSH. Use <strong>-r</strong> for directories.</div><div class="tt-example">scp file.txt user@host:/path/</div></div>'>scp</span> |
|
<span class="chip" data-tippy-content='<div class="tt a3"><div class="tt-cmd">rsync</div><div class="tt-desc">Efficiently sync files locally or over a network, transferring only what has changed.</div><div class="tt-example">rsync -avz src/ user@host:/dst/</div></div>'>rsync</span> |
|
<span class="chip" data-tippy-content='<div class="tt a3"><div class="tt-cmd">rm</div><div class="tt-desc">Remove a file. Use <strong>-rf</strong> to delete directories recursively. <em>No recycle bin — permanent!</em></div><div class="tt-example">rm -rf old_folder/</div></div>'>rm</span> |
|
</div> |
|
</div> |
|
|
|
<!-- Finding and Filtering --> |
|
<div class="card c2"> |
|
<div class="card-title">Finding & Filtering</div> |
|
<div class="chips"> |
|
<span class="chip" data-tippy-content='<div class="tt a2"><div class="tt-cmd">grep</div><div class="tt-desc">Search for a pattern inside files. Use <strong>-r</strong> for recursive, <strong>-i</strong> for case-insensitive, <strong>-n</strong> for line numbers.</div><div class="tt-example">grep -rin "error" /var/log/</div></div>'>grep</span> |
|
<span class="chip" data-tippy-content='<div class="tt a2"><div class="tt-cmd">find</div><div class="tt-desc">Search for files by name, type, size, date, and more. Can run a command on each result with <strong>-exec</strong>.</div><div class="tt-example">find . -name "*.log" -mtime -7</div></div>'>find</span> |
|
<span class="chip" data-tippy-content='<div class="tt a2"><div class="tt-cmd">which</div><div class="tt-desc">Show the full path of a command or binary as found in your <strong>$PATH</strong>.</div><div class="tt-example">which python3</div></div>'>which</span> |
|
<span class="chip" data-tippy-content='<div class="tt a2"><div class="tt-cmd">locate</div><div class="tt-desc">Find files by name using a nightly snapshot index. Much faster than <strong>find</strong>, but may be out of date.</div><div class="tt-example">locate nginx.conf</div></div>'>locate</span> |
|
<span class="chip" data-tippy-content='<div class="tt a2"><div class="tt-cmd">uniq</div><div class="tt-desc">Remove duplicate adjacent lines. Pipe from <strong>sort</strong> first to guarantee full deduplication.</div><div class="tt-example">sort names.txt | uniq</div></div>'>uniq</span> |
|
<span class="chip" data-tippy-content='<div class="tt a2"><div class="tt-cmd">sort</div><div class="tt-desc">Sort lines alphabetically. Use <strong>-n</strong> for numeric, <strong>-r</strong> for reverse, <strong>-u</strong> for unique.</div><div class="tt-example">sort -n scores.txt</div></div>'>sort</span> |
|
</div> |
|
</div> |
|
|
|
<!-- Bash Variables --> |
|
<div class="card c5"> |
|
<div class="card-title">Bash Variables & Functions</div> |
|
<div class="chips"> |
|
<span class="chip" data-tippy-content='<div class="tt a5"><div class="tt-cmd">$var</div><div class="tt-desc">Dollar sign dereferences a variable. Common built-ins: <strong>$PATH</strong>, <strong>$HOME</strong>, <strong>$USER</strong>, <strong>$PWD</strong>.</div><div class="tt-example">echo $PATH</div></div>'>$var</span> |
|
<span class="chip" data-tippy-content='<div class="tt a5"><div class="tt-cmd">alias</div><div class="tt-desc">Create a shortcut nickname for a command. Run alone to list all active aliases.</div><div class="tt-example">alias ll="ls -la"</div></div>'>alias</span> |
|
<span class="chip" data-tippy-content='<div class="tt a5"><div class="tt-cmd">function</div><div class="tt-desc">Define a reusable bash function with optional parameters. Put it in <strong>.bashrc</strong> to persist.</div><div class="tt-example">function greet() { echo "Hi $1"; }</div></div>'>function</span> |
|
<span class="chip" data-tippy-content='<div class="tt a5"><div class="tt-cmd">export</div><div class="tt-desc">Mark a variable so it is inherited by child processes and subshells in this session.</div><div class="tt-example">export EDITOR=vim</div></div>'>export</span> |
|
<span class="chip" data-tippy-content='<div class="tt a5"><div class="tt-cmd">env</div><div class="tt-desc">List all exported environment variables. Also used to run a command in a modified environment.</div><div class="tt-example">env | grep HOME</div></div>'>env</span> |
|
<span class="chip" data-tippy-content='<div class="tt a5"><div class="tt-cmd">xterm</div><div class="tt-desc">Launch a new terminal window. Append <strong>&</strong> to run it in the background without blocking.</div><div class="tt-example">xterm &</div></div>'>xterm</span> |
|
<span class="chip" data-tippy-content='<div class="tt a5"><div class="tt-cmd">set</div><div class="tt-desc">View or change shell options. <strong>set -x</strong> echoes every command (debug mode); <strong>set +x</strong> turns it off.</div><div class="tt-example">set -x # debug on |
|
set +x # debug off</div></div>'>set</span> |
|
</div> |
|
</div> |
|
|
|
<!-- Bash History --> |
|
<div class="card c5"> |
|
<div class="card-title">Bash History</div> |
|
<div class="chips"> |
|
<span class="chip" data-tippy-content='<div class="tt a5"><div class="tt-cmd">!!</div><div class="tt-desc">"bang bang" — re-run the previous command. Classic use: forgot sudo.</div><div class="tt-example">sudo !!</div></div>'>!!</span> |
|
<span class="chip" data-tippy-content='<div class="tt a5"><div class="tt-cmd">!$</div><div class="tt-desc">"bang dollar" — expands to the last argument of the previous command.</div><div class="tt-example">cat long/path/file.txt |
|
vim !$</div></div>'>!$</span> |
|
<span class="chip" data-tippy-content='<div class="tt a5"><div class="tt-cmd">!xxxxx</div><div class="tt-desc">Re-run the most recent command that <em>starts with</em> those letters.</div><div class="tt-example">!git # re-runs last git cmd |
|
!ssh # re-runs last ssh cmd</div></div>'>!xxxxx</span> |
|
<span class="chip" data-tippy-content='<div class="tt a5"><div class="tt-cmd"><ESC>,<Ctrl+E></div><div class="tt-desc">Expand a history shorthand (<strong>!!</strong>, <strong>!$</strong>, etc.) to its full text on the command line before running it.</div></div>'><ESC>,<Ctrl><E></span> |
|
<span class="chip" data-tippy-content='<div class="tt a5"><div class="tt-cmd"><Ctrl+R></div><div class="tt-desc">Reverse-search through command history interactively. Keep pressing to go further back.</div></div>'><Ctrl><R></span> |
|
</div> |
|
</div> |
|
|
|
<!-- Sessions --> |
|
<div class="card c1 wide"> |
|
<div class="card-title">Sessions</div> |
|
<div class="chips"> |
|
<span class="chip" data-tippy-content='<div class="tt a1"><div class="tt-cmd">su</div><div class="tt-desc">Switch User. Without arguments starts a root shell. Use <strong>su - user</strong> for a full login shell.</div><div class="tt-example">su - alice</div></div>'>su</span> |
|
<span class="chip" data-tippy-content='<div class="tt a1"><div class="tt-cmd">ssh</div><div class="tt-desc">Secure Shell — open an encrypted remote terminal session on another machine.</div><div class="tt-example">ssh alice@192.168.1.10</div></div>'>ssh</span> |
|
<span class="chip" data-tippy-content='<div class="tt a1"><div class="tt-cmd">exit</div><div class="tt-desc">End the current shell session. Also closes an SSH connection or a <strong>su</strong> session.</div><div class="tt-example">exit</div></div>'>exit</span> |
|
<span class="chip" data-tippy-content='<div class="tt a1"><div class="tt-cmd">logout</div><div class="tt-desc">End a login shell session. Equivalent to <strong>exit</strong> in most contexts.</div><div class="tt-example">logout</div></div>'>logout</span> |
|
<span class="chip" data-tippy-content='<div class="tt a1"><div class="tt-cmd">script</div><div class="tt-desc">Record everything printed to the terminal into a file for later review or audit.</div><div class="tt-example">script session.log</div></div>'>script</span> |
|
<span class="chip" data-tippy-content='<div class="tt a1"><div class="tt-cmd">screen</div><div class="tt-desc">Terminal multiplexer — keep sessions alive across disconnects. Also supports shared sessions.</div><div class="tt-example">screen -d -m -S shared |
|
screen -x shared</div></div>'>screen</span> |
|
<span class="chip" data-tippy-content='<div class="tt a1"><div class="tt-cmd">tmux</div><div class="tt-desc">Modern terminal multiplexer — persistent sessions, split panes, and full UTF-8 support.</div><div class="tt-example">tmux new -s work |
|
tmux attach -t work</div></div>'>tmux</span> |
|
</div> |
|
</div> |
|
|
|
<!-- Linking --> |
|
<div class="card c7"> |
|
<div class="card-title">Linking & Symlinks</div> |
|
<div class="chips"> |
|
<span class="chip" data-tippy-content='<div class="tt a7"><div class="tt-cmd">ln -s</div><div class="tt-desc">Create a symbolic (soft) link — a pointer to another file or directory anywhere on the filesystem.</div><div class="tt-example">ln -s /opt/app/bin/app ~/bin/app</div></div>'>ln -s</span> |
|
<span class="chip" data-tippy-content='<div class="tt a7"><div class="tt-cmd">unlink</div><div class="tt-desc">Remove a symbolic link without touching the target file it points to.</div><div class="tt-example">unlink ~/bin/app</div></div>'>unlink</span> |
|
</div> |
|
</div> |
|
|
|
<!-- Process Control --> |
|
<div class="card c6"> |
|
<div class="card-title">Process Control</div> |
|
<div class="chips"> |
|
<span class="chip" data-tippy-content='<div class="tt a6"><div class="tt-cmd">Ctrl+Z</div><div class="tt-desc">Suspend (pause) the foreground process. Resume it with <strong>fg</strong> or push to background with <strong>bg</strong>.</div></div>'>Ctrl+Z</span> |
|
<span class="chip" data-tippy-content='<div class="tt a6"><div class="tt-cmd">bg</div><div class="tt-desc">Resume a suspended job in the <strong>background</strong>, freeing your terminal prompt.</div><div class="tt-example">bg %1</div></div>'>bg</span> |
|
<span class="chip" data-tippy-content='<div class="tt a6"><div class="tt-cmd">fg</div><div class="tt-desc">Bring a background or suspended job to the <strong>foreground</strong>.</div><div class="tt-example">fg %1</div></div>'>fg</span> |
|
<span class="chip" data-tippy-content='<div class="tt a6"><div class="tt-cmd">jobs</div><div class="tt-desc">List all jobs (background/suspended) belonging to the current shell session.</div><div class="tt-example">jobs -l</div></div>'>jobs</span> |
|
<span class="chip" data-tippy-content='<div class="tt a6"><div class="tt-cmd">Ctrl+C</div><div class="tt-desc">Send SIGINT to the foreground process — kills most programs immediately.</div></div>'>Ctrl+C</span> |
|
<span class="chip" data-tippy-content='<div class="tt a6"><div class="tt-cmd">top</div><div class="tt-desc">Live process viewer with CPU/memory stats. Press <strong>q</strong> to quit, <strong>k</strong> to kill a process by PID.</div><div class="tt-example">top</div></div>'>top</span> |
|
<span class="chip" data-tippy-content='<div class="tt a6"><div class="tt-cmd">htop</div><div class="tt-desc">Colorful, interactive replacement for <strong>top</strong> — visual CPU bars, mouse support, easier navigation.</div><div class="tt-example">htop</div></div>'>htop</span> |
|
</div> |
|
</div> |
|
|
|
<!-- Other Users --> |
|
<div class="card c6"> |
|
<div class="card-title">Other Users</div> |
|
<div class="chips"> |
|
<span class="chip" data-tippy-content='<div class="tt a6"><div class="tt-cmd">w</div><div class="tt-desc">Who is logged in, plus their login time, idle time, and current command.</div><div class="tt-example">w</div></div>'>w</span> |
|
<span class="chip" data-tippy-content='<div class="tt a6"><div class="tt-cmd">wall</div><div class="tt-desc">Broadcast a message to every logged-in user on the system.</div><div class="tt-example">wall "Rebooting in 5 minutes!"</div></div>'>wall</span> |
|
<span class="chip" data-tippy-content='<div class="tt a6"><div class="tt-cmd">write</div><div class="tt-desc">Send a direct message to a single logged-in user's terminal.</div><div class="tt-example">echo "ping" | write alice</div></div>'>write</span> |
|
<span class="chip" data-tippy-content='<div class="tt a6"><div class="tt-cmd">finger</div><div class="tt-desc">Display identification info about a user: real name, login, home directory, shell.</div><div class="tt-example">finger alice</div></div>'>finger</span> |
|
<span class="chip" data-tippy-content='<div class="tt a6"><div class="tt-cmd">getent passwd</div><div class="tt-desc">Look up user info from the system database — works with local files, LDAP, and NIS.</div><div class="tt-example">getent passwd alice</div></div>'>getent passwd</span> |
|
</div> |
|
</div> |
|
|
|
<!-- Permissions --> |
|
<div class="card c3"> |
|
<div class="card-title">Permissions</div> |
|
<div class="chips"> |
|
<span class="chip" data-tippy-content='<div class="tt a3"><div class="tt-cmd">chmod</div><div class="tt-desc">Change file permissions — who can read, write, or execute. Use octal (<strong>755</strong>) or symbolic (<strong>u+x</strong>) notation.</div><div class="tt-example">chmod 755 script.sh</div></div>'>chmod</span> |
|
<span class="chip" data-tippy-content='<div class="tt a3"><div class="tt-cmd">chgrp</div><div class="tt-desc">Change the group ownership of a file or directory.</div><div class="tt-example">chgrp devteam project/</div></div>'>chgrp</span> |
|
<span class="chip" data-tippy-content='<div class="tt a3"><div class="tt-cmd">chown</div><div class="tt-desc">Change the owning user and/or group of a file.</div><div class="tt-example">chown alice:staff file.txt</div></div>'>chown</span> |
|
<span class="chip" data-tippy-content='<div class="tt a3"><div class="tt-cmd">sudo</div><div class="tt-desc">"Superuser do" — run a single command with elevated (root) privileges.</div><div class="tt-example">sudo apt update</div></div>'>sudo</span> |
|
</div> |
|
</div> |
|
|
|
<!-- Printing --> |
|
<div class="card c4"> |
|
<div class="card-title">Printing</div> |
|
<div class="chips"> |
|
<span class="chip" data-tippy-content='<div class="tt a4"><div class="tt-cmd">lp</div><div class="tt-desc">Send a file to the printer defined by <strong>$LPDEST</strong>. Use <strong>-d</strong> to specify a different printer by name.</div><div class="tt-example">lp -d laser1 report.pdf</div></div>'>lp</span> |
|
</div> |
|
</div> |
|
|
|
<!-- Zipping --> |
|
<div class="card c7"> |
|
<div class="card-title">Zipping / Unzipping</div> |
|
<div class="chips"> |
|
<span class="chip" data-tippy-content='<div class="tt a7"><div class="tt-cmd">tar</div><div class="tt-desc">Tape archive — pack & compress files. <strong>-czf</strong> creates .tar.gz; <strong>-xzf</strong> extracts it.</div><div class="tt-example">tar -czf out.tar.gz folder/ |
|
tar -xzf out.tar.gz</div></div>'>tar</span> |
|
<span class="chip" data-tippy-content='<div class="tt a7"><div class="tt-cmd">unzip</div><div class="tt-desc">Extract a .zip archive. Use <strong>-d</strong> to set the destination directory.</div><div class="tt-example">unzip archive.zip -d ./out/</div></div>'>unzip</span> |
|
</div> |
|
</div> |
|
|
|
<!-- Diffing --> |
|
<div class="card c8"> |
|
<div class="card-title">Diffing & Versioning</div> |
|
<div class="chips"> |
|
<span class="chip" data-tippy-content='<div class="tt a8"><div class="tt-cmd">diff</div><div class="tt-desc">Show line-by-line differences between two files. Use <strong>-u</strong> for unified patch-style output.</div><div class="tt-example">diff -u old.txt new.txt</div></div>'>diff</span> |
|
<span class="chip" data-tippy-content='<div class="tt a8"><div class="tt-cmd">tkdiff</div><div class="tt-desc">Graphical two-pane diff viewer. Requires a desktop session (X11).</div><div class="tt-example">tkdiff old.txt new.txt</div></div>'>tkdiff</span> |
|
<span class="chip" data-tippy-content='<div class="tt a8"><div class="tt-cmd">svn</div><div class="tt-desc">Subversion — centralized version control. All commits go to a shared central repository.</div><div class="tt-example">svn commit -m "fix: null check"</div></div>'>svn</span> |
|
<span class="chip" data-tippy-content='<div class="tt a8"><div class="tt-cmd">git</div><div class="tt-desc">Distributed version control — the modern standard. Full history tracked locally; push/pull to share.</div><div class="tt-example">git commit -am "update"</div></div>'>git</span> |
|
</div> |
|
</div> |
|
|
|
<!-- Scripting --> |
|
<div class="card c8"> |
|
<div class="card-title">Scripting Languages</div> |
|
<div class="chips"> |
|
<span class="chip" data-tippy-content='<div class="tt a8"><div class="tt-cmd">perl</div><div class="tt-desc">Files end in <strong>.pl</strong>. Pioneer of regex support; still widely used for text processing and sysadmin tasks.</div><div class="tt-example">perl -ne 'print if /error/i' app.log</div></div>'>perl</span> |
|
<span class="chip" data-tippy-content='<div class="tt a8"><div class="tt-cmd">python</div><div class="tt-desc">Files end in <strong>.py</strong>. Hugely popular general-purpose language. Use <strong>python3</strong> on modern systems.</div><div class="tt-example">python3 script.py</div></div>'>python</span> |
|
<span class="chip" data-tippy-content='<div class="tt a8"><div class="tt-cmd">bash</div><div class="tt-desc">"Bourne Again Shell" — the language of the Linux command line and the default for shell scripts.</div><div class="tt-example">bash myscript.sh</div></div>'>bash</span> |
|
<span class="chip" data-tippy-content='<div class="tt a8"><div class="tt-cmd">sh</div><div class="tt-desc">POSIX standard shell — more portable than bash but fewer features. Used in <strong>#!/bin/sh</strong> shebangs.</div><div class="tt-example">sh script.sh</div></div>'>sh</span> |
|
<span class="chip" data-tippy-content='<div class="tt a8"><div class="tt-cmd">ruby</div><div class="tt-desc">Files end in <strong>.rb</strong>. Expressive, object-oriented scripting language. Newer than Python.</div><div class="tt-example">ruby script.rb</div></div>'>ruby</span> |
|
</div> |
|
</div> |
|
|
|
<!-- Compilers --> |
|
<div class="card c8"> |
|
<div class="card-title">Compilers & Linkers</div> |
|
<div class="chips"> |
|
<span class="chip" data-tippy-content='<div class="tt a8"><div class="tt-cmd">gcc</div><div class="tt-desc">GNU C Compiler. Turns <strong>.c</strong> source files into object files or a final executable.</div><div class="tt-example">gcc -o app main.c</div></div>'>gcc</span> |
|
<span class="chip" data-tippy-content='<div class="tt a8"><div class="tt-cmd">g++</div><div class="tt-desc">GNU C++ Compiler. Turns <strong>.cpp</strong> source files into object files or a final executable.</div><div class="tt-example">g++ -o app main.cpp</div></div>'>g++</span> |
|
<span class="chip" data-tippy-content='<div class="tt a8"><div class="tt-cmd">ld</div><div class="tt-desc">The GNU linker. Combines compiled <strong>.o</strong> object files into a final executable or shared library.</div><div class="tt-example">ld -o app main.o util.o</div></div>'>ld</span> |
|
<span class="chip" data-tippy-content='<div class="tt a8"><div class="tt-cmd">make</div><div class="tt-desc">Automate compiling and linking via rules in a <strong>Makefile</strong>. Rebuilds only what has changed.</div><div class="tt-example">make all |
|
make clean</div></div>'>make</span> |
|
<span class="chip" data-tippy-content='<div class="tt a8"><div class="tt-cmd">configure</div><div class="tt-desc">A generated script that probes your system and produces a tuned <strong>Makefile</strong> for the build.</div><div class="tt-example">./configure --prefix=/usr/local |
|
make && make install</div></div>'>configure</span> |
|
</div> |
|
</div> |
|
|
|
<!-- Disk Utilities --> |
|
<div class="card c7"> |
|
<div class="card-title">Disk Utilities</div> |
|
<div class="chips"> |
|
<span class="chip" data-tippy-content='<div class="tt a7"><div class="tt-cmd">du</div><div class="tt-desc">Disk Usage — estimate space used under a directory. Use <strong>-sh</strong> for a single human-readable total.</div><div class="tt-example">du -sh /var/log</div></div>'>du</span> |
|
<span class="chip" data-tippy-content='<div class="tt a7"><div class="tt-cmd">du -sh ./*</div><div class="tt-desc">Show the size of every item in the current directory — quickly spot what is eating disk space.</div><div class="tt-example">du -sh ./* | sort -h</div></div>'>du -sh ./*</span> |
|
<span class="chip" data-tippy-content='<div class="tt a7"><div class="tt-cmd">df</div><div class="tt-desc">Disk Free — report filesystem disk space usage. Also useful for spotting NFS mounts.</div><div class="tt-example">df -h</div></div>'>df</span> |
|
<span class="chip" data-tippy-content='<div class="tt a7"><div class="tt-cmd">df -h</div><div class="tt-desc">List all mounted filesystems with used and available space in human-readable units (GB/MB).</div><div class="tt-example">df -h</div></div>'>df -h</span> |
|
<span class="chip" data-tippy-content='<div class="tt a7"><div class="tt-cmd">dd</div><div class="tt-desc">"Data Duplicator" — low-level byte-for-byte copy. Clone disks, create images, or wipe drives.</div><div class="tt-example">dd if=/dev/sda of=disk.img bs=4M</div></div>'>dd</span> |
|
</div> |
|
</div> |
|
|
|
</div> |
|
|
|
<footer>Linux Shell Quick Reference · Hover any command chip for description & example</footer> |
|
|
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/2.11.8/umd/popper.min.js"></script> |
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/tippy.js/6.3.7/tippy.umd.min.js"></script> |
|
<script> |
|
tippy('.chip', { |
|
content(ref) { return ref.getAttribute('data-tippy-content'); }, |
|
allowHTML: true, |
|
theme: 'terminal', |
|
placement: 'top', |
|
arrow: true, |
|
delay: [100, 50], |
|
duration: [150, 100], |
|
offset: [0, 8], |
|
maxWidth: 290, |
|
appendTo: document.body, |
|
}); |
|
</script> |
|
</body> |
|
</html> |
https://news.ycombinator.com/item?id=47525243