<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"><channel><title>Bash-Hacks</title><description>One useful bash one-liner every weekday, explained flag by flag.</description><link>https://bash-hacks.com/</link><language>en-us</language><item><title>Find the files that mention one thing but never mention another</title><link>https://bash-hacks.com/2026/11/02/050-find-files-that-mention-one-thing-but-not-another/</link><guid isPermaLink="true">https://bash-hacks.com/2026/11/02/050-find-files-that-mention-one-thing-but-not-another/</guid><description>grep -rl --null --include=&apos;*.js&apos; &apos;fetch(&apos; . | xargs -0 -r grep -L &apos;catch&apos;</description><pubDate>Mon, 02 Nov 2026 00:00:00 GMT</pubDate><category>grep</category><category>xargs</category><category>search</category><category>null-separated</category></item><item><title>Turn raw byte counts into human-readable sizes in any command&apos;s output</title><link>https://bash-hacks.com/2026/10/27/049-turn-byte-counts-into-human-readable-sizes/</link><guid isPermaLink="true">https://bash-hacks.com/2026/10/27/049-turn-byte-counts-into-human-readable-sizes/</guid><description>wc -c *.* | numfmt --field=1 --to=iec-i --suffix=B --padding=7</description><pubDate>Tue, 27 Oct 2026 00:00:00 GMT</pubDate><category>numfmt</category><category>units</category><category>bytes</category><category>formatting</category></item><item><title>Find out whether a slow command is working or waiting</title><link>https://bash-hacks.com/2026/10/26/048-find-out-if-a-slow-command-is-working-or-waiting/</link><guid isPermaLink="true">https://bash-hacks.com/2026/10/26/048-find-out-if-a-slow-command-is-working-or-waiting/</guid><description>time du -sh /usr</description><pubDate>Mon, 26 Oct 2026 00:00:00 GMT</pubDate><category>time</category><category>performance</category><category>cpu</category><category>debugging</category></item><item><title>Skip the header line of a file before you sort or count it</title><link>https://bash-hacks.com/2026/10/23/047-skip-the-header-line-of-a-file/</link><guid isPermaLink="true">https://bash-hacks.com/2026/10/23/047-skip-the-header-line-of-a-file/</guid><description>tail -n +2 sales.csv</description><pubDate>Fri, 23 Oct 2026 00:00:00 GMT</pubDate><category>tail</category><category>csv</category><category>headers</category><category>text</category></item><item><title>Split a line into named variables without losing them to a subshell</title><link>https://bash-hacks.com/2026/10/22/046-split-a-line-into-variables-without-a-subshell/</link><guid isPermaLink="true">https://bash-hacks.com/2026/10/22/046-split-a-line-into-variables-without-a-subshell/</guid><description>IFS=, read -r date region product units revenue &lt;&lt;&lt; &quot;$(sed -n 2p sales.csv)&quot;; echo &quot;$region $units&quot;</description><pubDate>Thu, 22 Oct 2026 00:00:00 GMT</pubDate><category>read</category><category>here-strings</category><category>ifs</category><category>scripting</category></item><item><title>See which commits are on a branch but not on main</title><link>https://bash-hacks.com/2026/10/21/045-see-which-commits-are-on-a-branch-but-not-on-main/</link><guid isPermaLink="true">https://bash-hacks.com/2026/10/21/045-see-which-commits-are-on-a-branch-but-not-on-main/</guid><description>git log --oneline main..feature</description><pubDate>Wed, 21 Oct 2026 00:00:00 GMT</pubDate><category>git-log</category><category>branches</category><category>revision-ranges</category></item><item><title>Check whether a compressed backup is corrupt before you need it</title><link>https://bash-hacks.com/2026/10/15/044-check-whether-a-gzip-file-is-corrupt/</link><guid isPermaLink="true">https://bash-hacks.com/2026/10/15/044-check-whether-a-gzip-file-is-corrupt/</guid><description>gzip -tv *.gz</description><pubDate>Thu, 15 Oct 2026 00:00:00 GMT</pubDate><category>gzip</category><category>integrity</category><category>backups</category><category>debugging</category></item><item><title>Find out how much disk a file really uses, not how big it claims to be</title><link>https://bash-hacks.com/2026/10/14/043-find-out-how-much-disk-a-sparse-file-really-uses/</link><guid isPermaLink="true">https://bash-hacks.com/2026/10/14/043-find-out-how-much-disk-a-sparse-file-really-uses/</guid><description>ls -lsh *.img</description><pubDate>Wed, 14 Oct 2026 00:00:00 GMT</pubDate><category>ls</category><category>sparse-files</category><category>filesystems</category><category>disk</category></item><item><title>Count from 01 to 12 with the zeros already in place</title><link>https://bash-hacks.com/2026/10/13/042-generate-a-zero-padded-number-sequence/</link><guid isPermaLink="true">https://bash-hacks.com/2026/10/13/042-generate-a-zero-padded-number-sequence/</guid><description>seq -w 1 12</description><pubDate>Tue, 13 Oct 2026 00:00:00 GMT</pubDate><category>seq</category><category>sequences</category><category>padding</category><category>loops</category></item><item><title>Check whether a process is still alive without sending it anything</title><link>https://bash-hacks.com/2026/10/12/041-check-whether-a-process-is-still-alive/</link><guid isPermaLink="true">https://bash-hacks.com/2026/10/12/041-check-whether-a-process-is-still-alive/</guid><description>kill -0 4721 &amp;&amp; echo alive || echo gone</description><pubDate>Mon, 12 Oct 2026 00:00:00 GMT</pubDate><category>kill</category><category>signals</category><category>pids</category><category>scripting</category></item><item><title>See a file&apos;s permissions as the number chmod expects</title><link>https://bash-hacks.com/2026/10/09/040-see-a-files-permissions-as-an-octal-number/</link><guid isPermaLink="true">https://bash-hacks.com/2026/10/09/040-see-a-files-permissions-as-an-octal-number/</guid><description>stat -c &apos;%04a %A %U:%G %n&apos; *</description><pubDate>Fri, 09 Oct 2026 00:00:00 GMT</pubDate><category>stat</category><category>permissions</category><category>chmod</category><category>metadata</category></item><item><title>Check if a remote port is open when netcat is not installed</title><link>https://bash-hacks.com/2026/10/08/039-check-if-a-port-is-open-without-netcat/</link><guid isPermaLink="true">https://bash-hacks.com/2026/10/08/039-check-if-a-port-is-open-without-netcat/</guid><description>timeout 3 bash -c &apos;&lt;/dev/tcp/bash-hacks.com/443&apos; &amp;&amp; echo open || echo closed</description><pubDate>Thu, 08 Oct 2026 00:00:00 GMT</pubDate><category>bash</category><category>dev-tcp</category><category>ports</category><category>debugging</category></item><item><title>See which keys can log in to an account without reading base64</title><link>https://bash-hacks.com/2026/10/07/038-see-which-keys-can-log-in-to-an-account/</link><guid isPermaLink="true">https://bash-hacks.com/2026/10/07/038-see-which-keys-can-log-in-to-an-account/</guid><description>ssh-keygen -lf ~/.ssh/authorized_keys</description><pubDate>Wed, 07 Oct 2026 00:00:00 GMT</pubDate><category>ssh-keygen</category><category>ssh</category><category>fingerprints</category><category>security</category></item><item><title>Count who has actually committed to a repository, and how much</title><link>https://bash-hacks.com/2026/10/06/037-count-commits-per-author/</link><guid isPermaLink="true">https://bash-hacks.com/2026/10/06/037-count-commits-per-author/</guid><description>git shortlog -sne --no-merges HEAD</description><pubDate>Tue, 06 Oct 2026 00:00:00 GMT</pubDate><category>git-shortlog</category><category>authorship</category><category>mailmap</category></item><item><title>Find out which stage of a pipeline actually failed</title><link>https://bash-hacks.com/2026/10/05/036-find-out-which-stage-of-a-pipeline-failed/</link><guid isPermaLink="true">https://bash-hacks.com/2026/10/05/036-find-out-which-stage-of-a-pipeline-failed/</guid><description>grep FATAL server.log | wc -l; echo &quot;${PIPESTATUS[@]}&quot;</description><pubDate>Mon, 05 Oct 2026 00:00:00 GMT</pubDate><category>pipestatus</category><category>pipefail</category><category>exit-codes</category><category>scripting</category></item><item><title>Pull only the matching records out of a JSON file</title><link>https://bash-hacks.com/2026/10/02/035-pull-matching-records-out-of-a-json-file/</link><guid isPermaLink="true">https://bash-hacks.com/2026/10/02/035-pull-matching-records-out-of-a-json-file/</guid><description>jq -r &apos;.servers[] | select(.cpu &gt; 60) | [.name, .ip, .cpu] | @tsv&apos; data.json</description><pubDate>Fri, 02 Oct 2026 00:00:00 GMT</pubDate><category>jq</category><category>json</category><category>filtering</category></item><item><title>Do decimal math in the shell when $(( )) only gives you integers</title><link>https://bash-hacks.com/2026/10/01/034-do-decimal-math-in-the-shell/</link><guid isPermaLink="true">https://bash-hacks.com/2026/10/01/034-do-decimal-math-in-the-shell/</guid><description>echo &apos;scale=3; 2/3&apos; | bc</description><pubDate>Thu, 01 Oct 2026 00:00:00 GMT</pubDate><category>bc</category><category>arithmetic</category><category>decimals</category><category>precision</category></item><item><title>Find out which compressor actually wins on your data before you pick one</title><link>https://bash-hacks.com/2026/09/30/033-find-out-which-compressor-wins-on-your-data/</link><guid isPermaLink="true">https://bash-hacks.com/2026/09/30/033-find-out-which-compressor-wins-on-your-data/</guid><description>for c in gzip bzip2 xz; do printf &apos;%-6s %10d\n&apos; $c $($c -9 -c access.log | wc -c); done</description><pubDate>Wed, 30 Sep 2026 00:00:00 GMT</pubDate><category>gzip</category><category>bzip2</category><category>xz</category><category>benchmarking</category></item><item><title>Read the load average without mistaking it for CPU usage</title><link>https://bash-hacks.com/2026/09/29/032-read-the-load-average-correctly/</link><guid isPermaLink="true">https://bash-hacks.com/2026/09/29/032-read-the-load-average-correctly/</guid><description>uptime</description><pubDate>Tue, 29 Sep 2026 00:00:00 GMT</pubDate><category>uptime</category><category>load-average</category><category>performance</category><category>debugging</category></item><item><title>See the SSH settings a host will actually use before you connect</title><link>https://bash-hacks.com/2026/09/28/031-see-the-ssh-settings-a-host-will-actually-use/</link><guid isPermaLink="true">https://bash-hacks.com/2026/09/28/031-see-the-ssh-settings-a-host-will-actually-use/</guid><description>ssh -G devbox | grep -E &apos;^(user|hostname|port|identityfile|proxyjump) &apos;</description><pubDate>Mon, 28 Sep 2026 00:00:00 GMT</pubDate><category>ssh</category><category>ssh-config</category><category>debugging</category></item><item><title>Line up a CSV into readable columns right in the terminal</title><link>https://bash-hacks.com/2026/09/25/030-line-up-a-csv-into-readable-columns/</link><guid isPermaLink="true">https://bash-hacks.com/2026/09/25/030-line-up-a-csv-into-readable-columns/</guid><description>column -s, -t sales.csv</description><pubDate>Fri, 25 Sep 2026 00:00:00 GMT</pubDate><category>column</category><category>csv</category><category>tables</category><category>formatting</category></item><item><title>Pull the filename, directory, or extension out of a path without basename</title><link>https://bash-hacks.com/2026/09/24/029-pull-apart-a-path-without-basename/</link><guid isPermaLink="true">https://bash-hacks.com/2026/09/24/029-pull-apart-a-path-without-basename/</guid><description>p=/var/log/nginx/access.log.2.gz; echo &quot;${p##*/} ${p%/*} ${p%.*} ${p##*.}&quot;</description><pubDate>Thu, 24 Sep 2026 00:00:00 GMT</pubDate><category>parameter-expansion</category><category>paths</category><category>filenames</category><category>scripting</category></item><item><title>Find out who actually wrote a line after a bulk reformat</title><link>https://bash-hacks.com/2026/09/23/028-find-who-actually-wrote-a-line-after-a-reformat/</link><guid isPermaLink="true">https://bash-hacks.com/2026/09/23/028-find-who-actually-wrote-a-line-after-a-reformat/</guid><description>git blame -w --ignore-revs-file .git-blame-ignore-revs src/auth.js</description><pubDate>Wed, 23 Sep 2026 00:00:00 GMT</pubDate><category>git-blame</category><category>authorship</category><category>refactoring</category></item><item><title>Identify a file by what is inside it, not what it is called</title><link>https://bash-hacks.com/2026/09/22/027-identify-a-file-by-its-contents/</link><guid isPermaLink="true">https://bash-hacks.com/2026/09/22/027-identify-a-file-by-its-contents/</guid><description>file *</description><pubDate>Tue, 22 Sep 2026 00:00:00 GMT</pubDate><category>file</category><category>magic-bytes</category><category>mime</category><category>debugging</category></item><item><title>See when a TLS certificate expires without opening a browser</title><link>https://bash-hacks.com/2026/09/21/026-see-when-a-tls-certificate-expires/</link><guid isPermaLink="true">https://bash-hacks.com/2026/09/21/026-see-when-a-tls-certificate-expires/</guid><description>openssl s_client -connect bash-hacks.com:443 -servername bash-hacks.com &lt;/dev/null 2&gt;/dev/null | openssl x509 -noout -subject -issuer -dates</description><pubDate>Mon, 21 Sep 2026 00:00:00 GMT</pubDate><category>openssl</category><category>tls</category><category>certificates</category><category>debugging</category></item><item><title>See the resource limits every process inherits from your shell</title><link>https://bash-hacks.com/2026/09/18/025-see-the-limits-every-process-inherits/</link><guid isPermaLink="true">https://bash-hacks.com/2026/09/18/025-see-the-limits-every-process-inherits/</guid><description>ulimit -a</description><pubDate>Fri, 18 Sep 2026 00:00:00 GMT</pubDate><category>ulimit</category><category>limits</category><category>file-descriptors</category><category>debugging</category></item><item><title>Do math on zero-padded numbers without the shell reading them as octal</title><link>https://bash-hacks.com/2026/09/17/024-do-math-on-zero-padded-numbers/</link><guid isPermaLink="true">https://bash-hacks.com/2026/09/17/024-do-math-on-zero-padded-numbers/</guid><description>echo $(( 10#$(date +%m) ))</description><pubDate>Thu, 17 Sep 2026 00:00:00 GMT</pubDate><category>arithmetic</category><category>base-conversion</category><category>octal</category><category>debugging</category></item><item><title>See exactly what rsync will change before it changes anything</title><link>https://bash-hacks.com/2026/09/16/023-see-what-rsync-will-do-before-it-runs/</link><guid isPermaLink="true">https://bash-hacks.com/2026/09/16/023-see-what-rsync-will-do-before-it-runs/</guid><description>rsync -avni --delete site/ backup/</description><pubDate>Wed, 16 Sep 2026 00:00:00 GMT</pubDate><category>rsync</category><category>sync</category><category>backup</category><category>dry-run</category></item><item><title>Total a column grouped by another one in a single pass</title><link>https://bash-hacks.com/2026/09/15/022-total-a-column-grouped-by-another/</link><guid isPermaLink="true">https://bash-hacks.com/2026/09/15/022-total-a-column-grouped-by-another/</guid><description>awk &apos;{n[$7]++; bytes[$7]+=$10} END {for (u in n) printf &quot;%12.0f %6d %s\n&quot;, bytes[u], n[u], u}&apos; access.log | sort -rn | head</description><pubDate>Tue, 15 Sep 2026 00:00:00 GMT</pubDate><category>awk</category><category>logs</category><category>aggregation</category><category>arrays</category></item><item><title>Find the process that is quietly eating your memory</title><link>https://bash-hacks.com/2026/09/14/021-find-the-process-eating-your-memory/</link><guid isPermaLink="true">https://bash-hacks.com/2026/09/14/021-find-the-process-eating-your-memory/</guid><description>ps -eo pid,ppid,rss,etimes,pcpu,comm --sort=-rss | head -11</description><pubDate>Mon, 14 Sep 2026 00:00:00 GMT</pubDate><category>ps</category><category>memory</category><category>rss</category><category>debugging</category></item><item><title>Search a project without walking into node_modules</title><link>https://bash-hacks.com/2026/09/08/018-search-a-project-without-walking-into-node-modules/</link><guid isPermaLink="true">https://bash-hacks.com/2026/09/08/018-search-a-project-without-walking-into-node-modules/</guid><description>find . \( -name node_modules -o -name .git \) -prune -o -type f -name &apos;*.ts&apos; -print</description><pubDate>Tue, 08 Sep 2026 00:00:00 GMT</pubDate><category>find</category><category>prune</category><category>search</category></item><item><title>Find out which part of an HTTP request is actually slow</title><link>https://bash-hacks.com/2026/09/07/017-find-out-which-part-of-a-request-is-slow/</link><guid isPermaLink="true">https://bash-hacks.com/2026/09/07/017-find-out-which-part-of-a-request-is-slow/</guid><description>curl -sS -o /dev/null -w &quot;dns   %{time_namelookup}\ntcp   %{time_connect}\ntls   %{time_appconnect}\nttfb  %{time_starttransfer}\ntotal %{time_total}\n&quot; https://www.debian.org</description><pubDate>Mon, 07 Sep 2026 00:00:00 GMT</pubDate><category>curl</category><category>http</category><category>latency</category><category>debugging</category></item><item><title>Bring back the commits you lost to a bad reset</title><link>https://bash-hacks.com/2026/09/04/016-bring-back-commits-lost-to-a-bad-reset/</link><guid isPermaLink="true">https://bash-hacks.com/2026/09/04/016-bring-back-commits-lost-to-a-bad-reset/</guid><description>git reflog show --date=relative HEAD</description><pubDate>Fri, 04 Sep 2026 00:00:00 GMT</pubDate><category>git-reflog</category><category>recovery</category><category>history</category></item><item><title>Compare the output of two commands without writing a temp file</title><link>https://bash-hacks.com/2026/09/03/015-compare-the-output-of-two-commands/</link><guid isPermaLink="true">https://bash-hacks.com/2026/09/03/015-compare-the-output-of-two-commands/</guid><description>diff &lt;(sort packages-web01.txt) &lt;(sort packages-web02.txt)</description><pubDate>Thu, 03 Sep 2026 00:00:00 GMT</pubDate><category>process-substitution</category><category>diff</category><category>comm</category></item><item><title>Turn a Unix timestamp into a readable date in any timezone</title><link>https://bash-hacks.com/2026/09/02/014-read-a-unix-timestamp-in-any-timezone/</link><guid isPermaLink="true">https://bash-hacks.com/2026/09/02/014-read-a-unix-timestamp-in-any-timezone/</guid><description>TZ=America/New_York date -d @1788373391 +&apos;%F %T %Z&apos;</description><pubDate>Wed, 02 Sep 2026 00:00:00 GMT</pubDate><category>date</category><category>timestamps</category><category>timezones</category></item><item><title>Reuse SSH connections instead of authenticating every time</title><link>https://bash-hacks.com/2026/09/01/013-reuse-ssh-connections-with-controlmaster/</link><guid isPermaLink="true">https://bash-hacks.com/2026/09/01/013-reuse-ssh-connections-with-controlmaster/</guid><description>ssh -o ControlMaster=auto -o ControlPath=~/.ssh/sockets/%r@%h-%p -o ControlPersist=600 devbox</description><pubDate>Tue, 01 Sep 2026 00:00:00 GMT</pubDate><category>ssh</category><category>multiplexing</category><category>performance</category></item><item><title>See what is inside a tarball without extracting it</title><link>https://bash-hacks.com/2026/08/31/012-see-whats-inside-a-tarball-without-extracting/</link><guid isPermaLink="true">https://bash-hacks.com/2026/08/31/012-see-whats-inside-a-tarball-without-extracting/</guid><description>tar -tzvf archive.tar.gz</description><pubDate>Mon, 31 Aug 2026 00:00:00 GMT</pubDate><category>tar</category><category>archives</category><category>inspection</category></item><item><title>Find out what a command actually is before you run it</title><link>https://bash-hacks.com/2026/08/28/011-find-out-what-a-command-actually-is/</link><guid isPermaLink="true">https://bash-hacks.com/2026/08/28/011-find-out-what-a-command-actually-is/</guid><description>type -a grep</description><pubDate>Fri, 28 Aug 2026 00:00:00 GMT</pubDate><category>type</category><category>aliases</category><category>debugging</category></item><item><title>Check how much disk space is left on every mounted filesystem</title><link>https://bash-hacks.com/2026/08/27/010-check-how-much-disk-space-is-left/</link><guid isPermaLink="true">https://bash-hacks.com/2026/08/27/010-check-how-much-disk-space-is-left/</guid><description>df -h</description><pubDate>Thu, 27 Aug 2026 00:00:00 GMT</pubDate><category>df</category><category>disk</category><category>filesystems</category></item><item><title>Search your Git history for a deleted function or string</title><link>https://bash-hacks.com/2026/08/26/009-search-git-history-for-deleted-code/</link><guid isPermaLink="true">https://bash-hacks.com/2026/08/26/009-search-git-history-for-deleted-code/</guid><description>git log -S&quot;handleAuth&quot; --oneline --all</description><pubDate>Wed, 26 Aug 2026 00:00:00 GMT</pubDate><category>git-log</category><category>history</category><category>search</category></item><item><title>Check where a domain name actually points</title><link>https://bash-hacks.com/2026/08/25/008-check-where-a-domain-points/</link><guid isPermaLink="true">https://bash-hacks.com/2026/08/25/008-check-where-a-domain-points/</guid><description>dig +short example.com</description><pubDate>Tue, 25 Aug 2026 00:00:00 GMT</pubDate><category>dig</category><category>dns</category><category>debugging</category></item><item><title>Sort a CSV by any column without opening a spreadsheet</title><link>https://bash-hacks.com/2026/08/24/007-sort-csv-by-column/</link><guid isPermaLink="true">https://bash-hacks.com/2026/08/24/007-sort-csv-by-column/</guid><description>sort -t, -k3 -nr sales.csv | head -20</description><pubDate>Mon, 24 Aug 2026 00:00:00 GMT</pubDate><category>sort</category><category>csv</category><category>text</category></item><item><title>Find out what is actually eating your disk</title><link>https://bash-hacks.com/2026/08/21/006-find-what-is-eating-your-disk/</link><guid isPermaLink="true">https://bash-hacks.com/2026/08/21/006-find-what-is-eating-your-disk/</guid><description>du -h -d1 . | sort -hr | head -10</description><pubDate>Fri, 21 Aug 2026 00:00:00 GMT</pubDate><category>du</category><category>disk</category><category>sorting</category></item><item><title>Find out which process is sitting on port 8080</title><link>https://bash-hacks.com/2026/08/20/005-find-process-on-port-8080/</link><guid isPermaLink="true">https://bash-hacks.com/2026/08/20/005-find-process-on-port-8080/</guid><description>lsof -nP -iTCP:8080 -sTCP:LISTEN</description><pubDate>Thu, 20 Aug 2026 00:00:00 GMT</pubDate><category>lsof</category><category>ports</category><category>debugging</category></item></channel></rss>