<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
  <title>Bash-Hacks</title>
  <subtitle>One useful bash one-liner every weekday, explained flag by flag.</subtitle>
  <link href="https://bash-hacks.com/" />
  <link href="https://bash-hacks.com/atom.xml" rel="self" />
  <id>https://bash-hacks.com/</id>
  <updated>2026-09-16T00:00:00.000Z</updated>
  <entry>
    <title>See exactly what rsync will change before it changes anything</title>
    <link href="https://bash-hacks.com/2026/09/16/023-see-what-rsync-will-do-before-it-runs/" />
    <id>https://bash-hacks.com/2026/09/16/023-see-what-rsync-will-do-before-it-runs/</id>
    <updated>2026-09-16T00:00:00.000Z</updated>
    <summary>rsync -avni --delete site/ backup/</summary>
    <category term="ssh-remote" />
  </entry>
  <entry>
    <title>Total a column grouped by another one in a single pass</title>
    <link href="https://bash-hacks.com/2026/09/15/022-total-a-column-grouped-by-another/" />
    <id>https://bash-hacks.com/2026/09/15/022-total-a-column-grouped-by-another/</id>
    <updated>2026-09-15T00:00:00.000Z</updated>
    <summary>awk '{n[$7]++; bytes[$7]+=$10} END {for (u in n) printf &quot;%12.0f %6d %s\n&quot;, bytes[u], n[u], u}' access.log | sort -rn | head</summary>
    <category term="text-processing" />
  </entry>
  <entry>
    <title>Find the process that is quietly eating your memory</title>
    <link href="https://bash-hacks.com/2026/09/14/021-find-the-process-eating-your-memory/" />
    <id>https://bash-hacks.com/2026/09/14/021-find-the-process-eating-your-memory/</id>
    <updated>2026-09-14T00:00:00.000Z</updated>
    <summary>ps -eo pid,ppid,rss,etimes,pcpu,comm --sort=-rss | head -11</summary>
    <category term="processes-jobs" />
  </entry>
  <entry>
    <title>Search a project without walking into node_modules</title>
    <link href="https://bash-hacks.com/2026/09/08/018-search-a-project-without-walking-into-node-modules/" />
    <id>https://bash-hacks.com/2026/09/08/018-search-a-project-without-walking-into-node-modules/</id>
    <updated>2026-09-08T00:00:00.000Z</updated>
    <summary>find . \( -name node_modules -o -name .git \) -prune -o -type f -name '*.ts' -print</summary>
    <category term="files-search" />
  </entry>
  <entry>
    <title>Find out which part of an HTTP request is actually slow</title>
    <link href="https://bash-hacks.com/2026/09/07/017-find-out-which-part-of-a-request-is-slow/" />
    <id>https://bash-hacks.com/2026/09/07/017-find-out-which-part-of-a-request-is-slow/</id>
    <updated>2026-09-07T00:00:00.000Z</updated>
    <summary>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</summary>
    <category term="networking" />
  </entry>
  <entry>
    <title>Bring back the commits you lost to a bad reset</title>
    <link href="https://bash-hacks.com/2026/09/04/016-bring-back-commits-lost-to-a-bad-reset/" />
    <id>https://bash-hacks.com/2026/09/04/016-bring-back-commits-lost-to-a-bad-reset/</id>
    <updated>2026-09-04T00:00:00.000Z</updated>
    <summary>git reflog show --date=relative HEAD</summary>
    <category term="git" />
  </entry>
  <entry>
    <title>Compare the output of two commands without writing a temp file</title>
    <link href="https://bash-hacks.com/2026/09/03/015-compare-the-output-of-two-commands/" />
    <id>https://bash-hacks.com/2026/09/03/015-compare-the-output-of-two-commands/</id>
    <updated>2026-09-03T00:00:00.000Z</updated>
    <summary>diff &lt;(sort packages-web01.txt) &lt;(sort packages-web02.txt)</summary>
    <category term="shell-tricks" />
  </entry>
  <entry>
    <title>Turn a Unix timestamp into a readable date in any timezone</title>
    <link href="https://bash-hacks.com/2026/09/02/014-read-a-unix-timestamp-in-any-timezone/" />
    <id>https://bash-hacks.com/2026/09/02/014-read-a-unix-timestamp-in-any-timezone/</id>
    <updated>2026-09-02T00:00:00.000Z</updated>
    <summary>TZ=America/New_York date -d @1788373391 +'%F %T %Z'</summary>
    <category term="dates-math" />
  </entry>
  <entry>
    <title>Reuse SSH connections instead of authenticating every time</title>
    <link href="https://bash-hacks.com/2026/09/01/013-reuse-ssh-connections-with-controlmaster/" />
    <id>https://bash-hacks.com/2026/09/01/013-reuse-ssh-connections-with-controlmaster/</id>
    <updated>2026-09-01T00:00:00.000Z</updated>
    <summary>ssh -o ControlMaster=auto -o ControlPath=~/.ssh/sockets/%r@%h-%p -o ControlPersist=600 devbox</summary>
    <category term="ssh-remote" />
  </entry>
  <entry>
    <title>See what is inside a tarball without extracting it</title>
    <link href="https://bash-hacks.com/2026/08/31/012-see-whats-inside-a-tarball-without-extracting/" />
    <id>https://bash-hacks.com/2026/08/31/012-see-whats-inside-a-tarball-without-extracting/</id>
    <updated>2026-08-31T00:00:00.000Z</updated>
    <summary>tar -tzvf archive.tar.gz</summary>
    <category term="archives-compression" />
  </entry>
  <entry>
    <title>Find out what a command actually is before you run it</title>
    <link href="https://bash-hacks.com/2026/08/28/011-find-out-what-a-command-actually-is/" />
    <id>https://bash-hacks.com/2026/08/28/011-find-out-what-a-command-actually-is/</id>
    <updated>2026-08-28T00:00:00.000Z</updated>
    <summary>type -a grep</summary>
    <category term="shell-tricks" />
  </entry>
  <entry>
    <title>Check how much disk space is left on every mounted filesystem</title>
    <link href="https://bash-hacks.com/2026/08/27/010-check-how-much-disk-space-is-left/" />
    <id>https://bash-hacks.com/2026/08/27/010-check-how-much-disk-space-is-left/</id>
    <updated>2026-08-27T00:00:00.000Z</updated>
    <summary>df -h</summary>
    <category term="disk-system" />
  </entry>
  <entry>
    <title>Search your Git history for a deleted function or string</title>
    <link href="https://bash-hacks.com/2026/08/26/009-search-git-history-for-deleted-code/" />
    <id>https://bash-hacks.com/2026/08/26/009-search-git-history-for-deleted-code/</id>
    <updated>2026-08-26T00:00:00.000Z</updated>
    <summary>git log -S&quot;handleAuth&quot; --oneline --all</summary>
    <category term="git" />
  </entry>
  <entry>
    <title>Check where a domain name actually points</title>
    <link href="https://bash-hacks.com/2026/08/25/008-check-where-a-domain-points/" />
    <id>https://bash-hacks.com/2026/08/25/008-check-where-a-domain-points/</id>
    <updated>2026-08-25T00:00:00.000Z</updated>
    <summary>dig +short example.com</summary>
    <category term="networking" />
  </entry>
  <entry>
    <title>Sort a CSV by any column without opening a spreadsheet</title>
    <link href="https://bash-hacks.com/2026/08/24/007-sort-csv-by-column/" />
    <id>https://bash-hacks.com/2026/08/24/007-sort-csv-by-column/</id>
    <updated>2026-08-24T00:00:00.000Z</updated>
    <summary>sort -t, -k3 -nr sales.csv | head -20</summary>
    <category term="text-processing" />
  </entry>
  <entry>
    <title>Find out what is actually eating your disk</title>
    <link href="https://bash-hacks.com/2026/08/21/006-find-what-is-eating-your-disk/" />
    <id>https://bash-hacks.com/2026/08/21/006-find-what-is-eating-your-disk/</id>
    <updated>2026-08-21T00:00:00.000Z</updated>
    <summary>du -h -d1 . | sort -hr | head -10</summary>
    <category term="files-search" />
  </entry>
  <entry>
    <title>Find out which process is sitting on port 8080</title>
    <link href="https://bash-hacks.com/2026/08/20/005-find-process-on-port-8080/" />
    <id>https://bash-hacks.com/2026/08/20/005-find-process-on-port-8080/</id>
    <updated>2026-08-20T00:00:00.000Z</updated>
    <summary>lsof -nP -iTCP:8080 -sTCP:LISTEN</summary>
    <category term="processes-jobs" />
  </entry>
</feed>