How Do You Search Text with grep in Linux?
grep prints the lines that match a pattern. Learn its everyday options, recursive search, context lines and exit status for scripts.
72 posts about Linux: questions with answers, tutorials and articles, newest first.
grep prints the lines that match a pattern. Learn its everyday options, recursive search, context lines and exit status for scripts.
AddressSanitizer and Valgrind find leaks, overflows and use after free in C++ programs. See the commands, sample reports and when to use each tool.
Create a non-root user with sudo rights, copy your SSH key, test it and then disable SSH root login safely so you cannot lock yourself out.
Generate an Ed25519 SSH key, add the public key to GitHub, test with ssh -T and switch your remotes to SSH URLs.
The cut command pulls fields or character ranges out of each line. See delimiters, ranges, system file examples and where cut falls short.
Connect to a remote server with ssh user@host, verify the host fingerprint, log in with a password or key file and fix common connection errors.
Combine sort and uniq to order text, drop duplicate lines and build frequency counts. Covers key options, locale effects and the sort -u shortcut.
The wc command counts lines, words, bytes and characters. See each option, how to count piped output and how to get a bare number for scripts.
A pipe sends one command's output straight into another command's input. Learn how pipelines work, how to chain tools and how to handle errors.
Learn how to run a Bitcoin full node with Bitcoin Core on Linux: requirements, verified install, bitcoin.conf, pruning, the initial sync and safe operation.
The > operator overwrites a file with command output and >> appends to it. Learn how to redirect errors, avoid data loss and write root-owned files.
Every Linux process has stdin, stdout and stderr, numbered 0, 1 and 2. See how they differ and how to redirect each one in the shell.
Find text with / and ?, replace it with :%s and confirm each change, then move faster with f, t, %, marks and the jump list.
Vim is a modal editor, so keys do different things in each mode. Learn how to type, save, quit, move and edit, and how to get unstuck with Esc.
nano is the simplest terminal text editor on Linux. Learn to open, edit, save and exit files, plus the shortcuts for cut, paste, search and replace.
tail -f prints the end of a file and keeps streaming new lines as they are written. Learn -n, -F for rotated logs, grep filtering and journalctl -f.
Read the start or end of a file with head and tail, follow growing logs with tail -F and pick line ranges by combining the two commands.
Print files with cat, scroll and search long files with less, and know when the older more pager still makes sense on a Linux system.
Compress and decompress files with gzip, bzip2, xz and zip, compare speed and size, and learn to read compressed files without extracting them.
Create, list and extract tar archives with the right options, pick gzip, xz or zstd compression, exclude files and stream archives over SSH.