<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Terminal on Jake Worth</title><link>https://jakeworth.com/tags/terminal/</link><description>Recent content in Terminal on Jake Worth</description><image><title>Jake Worth</title><url>https://jakeworth.com/twittercard.png</url><link>https://jakeworth.com/twittercard.png</link></image><generator>Hugo</generator><language>en-us</language><lastBuildDate>Mon, 01 Jun 2026 12:30:02 -0400</lastBuildDate><atom:link href="https://jakeworth.com/tags/terminal/index.xml" rel="self" type="application/rss+xml"/><item><title>Overwrite vs. Append</title><link>https://jakeworth.com/tils/overwrite-vs-append/</link><pubDate>Fri, 13 Mar 2026 16:01:22 -0400</pubDate><guid>https://jakeworth.com/tils/overwrite-vs-append/</guid><description>&lt;p&gt;I use the append &lt;code&gt;&amp;gt;&amp;gt;&lt;/code&gt; and overwrite &lt;code&gt;&amp;gt;&lt;/code&gt; redirection operators all the time. Today I&amp;rsquo;d like to share a simple mental model I&amp;rsquo;ve developed for remembering which is which.&lt;/p&gt;</description></item><item><title>Who Owns This Program?</title><link>https://jakeworth.com/tils/who-owns-this-program/</link><pubDate>Mon, 09 Feb 2026 10:36:33 -0500</pubDate><guid>https://jakeworth.com/tils/who-owns-this-program/</guid><description>&lt;p&gt;I&amp;rsquo;ve got a command &lt;code&gt;docker&lt;/code&gt; on my machine. I need to upgrade it. So, who owns it?&lt;/p&gt;</description></item><item><title>Calculating With Bc</title><link>https://jakeworth.com/tils/calculating-with-bc/</link><pubDate>Wed, 07 Jan 2026 09:48:26 -0500</pubDate><guid>https://jakeworth.com/tils/calculating-with-bc/</guid><description>&lt;p&gt;Today I accidentally I found a calculator on my computer, &lt;code&gt;bc&lt;/code&gt;. Let&amp;rsquo;s look at it!&lt;/p&gt;</description></item><item><title>pbcopy, no cat</title><link>https://jakeworth.com/tils/pbcopy-no-cat/</link><pubDate>Wed, 05 Mar 2025 10:07:24 -0500</pubDate><guid>https://jakeworth.com/tils/pbcopy-no-cat/</guid><description>&lt;p&gt;My friend Josh recently wrote about a common mistake using &lt;code&gt;pbcopy&lt;/code&gt;, Apple&amp;rsquo;s pasteboard utility.&lt;/p&gt;</description></item><item><title>Read Zsh Builtin Manual Pages</title><link>https://jakeworth.com/tils/read-zsh-builtin-manual-pages/</link><pubDate>Wed, 22 May 2024 12:30:02 -0400</pubDate><guid>https://jakeworth.com/tils/read-zsh-builtin-manual-pages/</guid><description>&lt;p&gt;In Zsh, if you type &lt;code&gt;man cd&lt;/code&gt;, instead of a manual page, you&amp;rsquo;ll get this:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;See the built-in command description in the appropriate shell manual page.
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;To see Zsh&amp;rsquo;s implementation of &lt;code&gt;cd&lt;/code&gt;, we need to view Zsh&amp;rsquo;s built-in man page:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;man zshbuiltins
&lt;/code&gt;&lt;/pre&gt;</description></item><item><title>Append to a Write-Protected File</title><link>https://jakeworth.com/tils/append-to-a-write-protected-file/</link><pubDate>Thu, 22 Feb 2024 08:32:29 -0500</pubDate><guid>https://jakeworth.com/tils/append-to-a-write-protected-file/</guid><description>&lt;p&gt;Suppose you want to append to a file that&amp;rsquo;s write-protected and can only be
edited via &lt;code&gt;sudo&lt;/code&gt;. Is that possible? It is!&lt;/p&gt;
&lt;p&gt;A technique I discovered today is to use &lt;code&gt;tee&lt;/code&gt; with &lt;code&gt;sudo&lt;/code&gt;:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;$ cat file.txt | sudo tee -a /etc/hosts
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This lets me append the contents of &lt;code&gt;file.txt&lt;/code&gt; to the write-protected
&lt;code&gt;/etc/hosts&lt;/code&gt; file by entering my password.&lt;/p&gt;</description></item><item><title>Create a File With `cat`</title><link>https://jakeworth.com/tils/create-a-file-with-cat/</link><pubDate>Tue, 12 Dec 2023 13:51:16 -0500</pubDate><guid>https://jakeworth.com/tils/create-a-file-with-cat/</guid><description>&lt;p&gt;When you combine &lt;code&gt;cat&lt;/code&gt; (concatenate) with &lt;code&gt;&amp;gt;&lt;/code&gt; (output redirection),
you can create and write to a file from the command line.&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;$ cat &amp;gt; test.txt
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Hit enter after the file name, and your terminal will wait for input. End the
file with &lt;code&gt;CTRL + D&lt;/code&gt;.&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;$ cat &amp;gt; test.txt
one
two
three
$ cat test.txt
one
two
three
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&lt;code&gt;&amp;gt;&amp;gt;&lt;/code&gt; works, too; appending to the file as expected.&lt;/p&gt;</description></item><item><title>Override Autojump's Directory Rankings</title><link>https://jakeworth.com/tils/override-autojumps-directory-rankings/</link><pubDate>Wed, 08 Mar 2023 10:12:50 -0500</pubDate><guid>https://jakeworth.com/tils/override-autojumps-directory-rankings/</guid><description>&lt;p&gt;&lt;a href="https://github.com/wting/autojump"&gt;Autojump&lt;/a&gt; is my tool of choice for
navigating directories. If I enter the following into the terminal:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;$ j til
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Autojump will try to guess where I want to go among directories I&amp;rsquo;ve previously
visited. It uses a database of directories and their relative rankings to do
so.&lt;/p&gt;
&lt;p&gt;But there&amp;rsquo;s a problem! These day I only want to visit &lt;code&gt;~/oss/til&lt;/code&gt;. In the past
I&amp;rsquo;ve visited &lt;code&gt;~/oss/hr-til&lt;/code&gt; and &lt;code&gt;~/oss/tilex&lt;/code&gt; hundreds of times. Autojump
always sends me there first. I don&amp;rsquo;t want that!&lt;/p&gt;</description></item><item><title>Force ASDF Reshim</title><link>https://jakeworth.com/tils/force-asdf-reshim/</link><pubDate>Tue, 21 Jun 2022 09:49:59 -0400</pubDate><guid>https://jakeworth.com/tils/force-asdf-reshim/</guid><description>&lt;p&gt;When I upgrade ASDF, I sometimes get an error like this when I try to run a
command:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;/Users/jakeworth/.asdf/shims/jq: line 3:
/usr/local/Cellar/asdf/0.9.0/libexec/bin/asdf:
No such file or directory
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The issue is that I&amp;rsquo;ve upgraded ADSF to v0.10.2, but the jq shim doesn&amp;rsquo;t know
that and can&amp;rsquo;t find it in a directory called &amp;ldquo;0.9.0&amp;rdquo;. This issue persists even
after running &lt;code&gt;asdf reshim&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;My solution is to force ASDF to rebuild shims directory by renaming it. A
rename lets me get back to where I am now, in case I need to.&lt;/p&gt;</description></item><item><title>Ctags Dotfiles</title><link>https://jakeworth.com/tils/ctags-dotfiles/</link><pubDate>Fri, 18 Mar 2022 12:11:25 -0400</pubDate><guid>https://jakeworth.com/tils/ctags-dotfiles/</guid><description>&lt;p&gt;Something I took for granted at Hashrocket was the file that configures
&lt;a href="http://ctags.sourceforge.net/"&gt;Exhuberant Ctags&lt;/a&gt;. Without configuration,
recursive tag generation will tag many things and cause problems. overindex
badly.&lt;/p&gt;
&lt;p&gt;Here&amp;rsquo;s how you configure Ctags to ignore things:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;/ctags.cnf (on MSDOS, MSWindows only)
/etc/ctags.conf
/usr/local/etc/ctags.conf
$HOME/.ctags
$HOME/ctags.cnf (on MSDOS, MSWindows only)
.ctags
ctags.cnf (on MSDOS, MSWindows only)
If any of these configuration files exist, each will be expected to contain a
set of default options which are read in the order listed when ctags starts,
but before the CTAGS environment variable is read or any command line options
are read. This makes it possible to set up site-wide, personal or project-level
defaults.
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Here&amp;rsquo;s the &lt;code&gt;head&lt;/code&gt; of my root &lt;code&gt;.ctags&lt;/code&gt;, which even this far in is excluding a
lot:&lt;/p&gt;</description></item><item><title>Save Size Change to iTerm Profile</title><link>https://jakeworth.com/tils/save-size-changes-to-iterm-profile/</link><pubDate>Sat, 13 Nov 2021 13:35:21 -0500</pubDate><guid>https://jakeworth.com/tils/save-size-changes-to-iterm-profile/</guid><description>&lt;p&gt;The longer I program (ahem), the bigger I want my terminal fonts. I think most
programmers should be using a bigger font than they are. Complicating matters,
the standard font for iTerm is miniscule on a computer monitor.&lt;/p&gt;
&lt;p&gt;Today I discovered iTerm&amp;rsquo;s &amp;lsquo;View &amp;gt; Size Changes Update Profile&amp;rsquo; feature. When
enabled, changes to your font size via &lt;code&gt;⌘ +&lt;/code&gt; and &lt;code&gt;⌘ -&lt;/code&gt; will be applied to your
iTerm profile. The next time you open iTerm, the new font size will persist.&lt;/p&gt;</description></item><item><title>Autojump and Open</title><link>https://jakeworth.com/tils/autojump-and-open/</link><pubDate>Sat, 06 Nov 2021 13:39:32 -0400</pubDate><guid>https://jakeworth.com/tils/autojump-and-open/</guid><description>&lt;p&gt;I love &lt;a href="https://github.com/wting/autojump"&gt;autojump&lt;/a&gt;. I use it because I think
that remembering my location in a directory structure relative to other
directories, so I can navigate with &lt;code&gt;cd&lt;/code&gt;, is mental energy I could be using for
something else.&lt;/p&gt;
&lt;p&gt;Today I learned that autojump has a &lt;code&gt;jo&lt;/code&gt; command, which &lt;em&gt;jumps&lt;/em&gt; to a directory
and &lt;em&gt;opens&lt;/em&gt; it in your file explorer.&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;jo Desktop
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This might be a throwaway lesson if I wasn&amp;rsquo;t regularly sidetracked by the MacOS
file explorer. Finding a file using the file explorer is a routine operation I
have yet to do fluidly on a Mac. This helps!&lt;/p&gt;</description></item><item><title>Command Line Subshell</title><link>https://jakeworth.com/tils/command-line-subshell/</link><pubDate>Mon, 02 Aug 2021 11:34:14 -0400</pubDate><guid>https://jakeworth.com/tils/command-line-subshell/</guid><description>&lt;p&gt;When chaining commands in the terminal, you may need to do things that affect
the shell&amp;rsquo;s environment, like change directories. Here&amp;rsquo;s an example:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;$ yarn install &amp;amp;&amp;amp; cd ios &amp;amp;&amp;amp; pod install &amp;amp;&amp;amp; cd .. &amp;amp;&amp;amp; yarn build
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;These &lt;code&gt;cd&lt;/code&gt;&amp;rsquo;s can clutter up a script, and they&amp;rsquo;re incidental. My solution is to
use a subshell (here&amp;rsquo;s the explanation from &lt;code&gt;man bash&lt;/code&gt;):&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;(list) list is executed in a subshell environment (see COMMAND EXECUTION ENVIRONMENT below). Variable
assignments and builtin commands that affect the shell&amp;rsquo;s environment do not remain in effect
after the command completes. The return status is the exit status of list.&lt;/p&gt;</description></item><item><title>Directional Commands</title><link>https://jakeworth.com/tils/directional-commands/</link><pubDate>Wed, 21 Apr 2021 16:50:27 -0400</pubDate><guid>https://jakeworth.com/tils/directional-commands/</guid><description>&lt;p&gt;You can move the cursor without arrow keys. Here is the keyboard equivalent for each.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Up (&amp;lsquo;previous&amp;rsquo;): &lt;code&gt;CTRL + P&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Down (&amp;rsquo;next&amp;rsquo;): &lt;code&gt;CTRL + N&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Left (&amp;lsquo;back&amp;rsquo;): &lt;code&gt;CTRL + B&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Right (&amp;lsquo;forward&amp;rsquo;): &lt;code&gt;CTRL + F&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Mapping &lt;code&gt;caps lock&lt;/code&gt; to &lt;code&gt;CTRL&lt;/code&gt; makes these combinations very accessible.&lt;/p&gt;</description></item><item><title>Finding Getters</title><link>https://jakeworth.com/tils/finding-getters/</link><pubDate>Wed, 21 Apr 2021 16:50:27 -0400</pubDate><guid>https://jakeworth.com/tils/finding-getters/</guid><description>&lt;p&gt;After writing the other day about why you &lt;a href="http://til.hashrocket.com/posts/7d6b8eb8d3-accessor-performance-gap"&gt;might not want to use simple getters&lt;/a&gt;, I decided that I wanted to eliminate all such methods from a project.&lt;/p&gt;
&lt;p&gt;Here is the regex I wrote to isolate the pattern:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;ag &amp;#39;def (\w+);?\s+@\1;?\s+end&amp;#39;
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;The semicolon catches one-line getter methods as well as the more common three-line.&lt;/p&gt;</description></item><item><title>MD5 File Signatures</title><link>https://jakeworth.com/tils/md5-file-signatures/</link><pubDate>Wed, 21 Apr 2021 16:50:27 -0400</pubDate><guid>https://jakeworth.com/tils/md5-file-signatures/</guid><description>&lt;p&gt;The command &lt;code&gt;md5 &amp;lt;file&amp;gt;&lt;/code&gt; generates a unique 32-digit hexadecimal number. This can serve as a signature for a file in its particular state, letting you know when it has changed.&lt;/p&gt;
&lt;p&gt;Example usage:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;$ touch test.txt
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;$ md5 test.txt
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; MD5 &lt;span style="color:#f92672"&gt;(&lt;/span&gt;test.txt&lt;span style="color:#f92672"&gt;)&lt;/span&gt; &lt;span style="color:#f92672"&gt;=&lt;/span&gt; d41d8cd98f00b204e9800998ecf8427e
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;$ echo &lt;span style="color:#e6db74"&gt;&amp;#39;some content&amp;#39;&lt;/span&gt; &amp;gt; test.txt
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;$ md5 test.txt
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; MD5 &lt;span style="color:#f92672"&gt;(&lt;/span&gt;test.txt&lt;span style="color:#f92672"&gt;)&lt;/span&gt; &lt;span style="color:#f92672"&gt;=&lt;/span&gt; eb9c2bf0eb63f3a7bc0ea37ef18aeba5
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</description></item><item><title>Printing with lpr</title><link>https://jakeworth.com/tils/printing-with-lpr/</link><pubDate>Wed, 21 Apr 2021 16:50:27 -0400</pubDate><guid>https://jakeworth.com/tils/printing-with-lpr/</guid><description>&lt;p&gt;Recently while trying to fix a printer I used &lt;code&gt;lpr&lt;/code&gt; a bunch of times. It&amp;rsquo;s not exactly new to me, but never fails to surprise people when I use it.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;lpr&lt;/code&gt; submits files for printing to your default printer in OSX.&lt;/p&gt;
&lt;p&gt;Print a file:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;lpr README.md
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Print the current file in your Vim session, with a &lt;em&gt;cool job name&lt;/em&gt;:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;:! lpr -T &amp;#39;cool job name&amp;#39; %
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Print two copies to a specific printer:&lt;/p&gt;</description></item><item><title>Reverse a String</title><link>https://jakeworth.com/tils/reverse-a-string/</link><pubDate>Wed, 21 Apr 2021 16:50:27 -0400</pubDate><guid>https://jakeworth.com/tils/reverse-a-string/</guid><description>&lt;p&gt;Reverse a string with the &lt;code&gt;rev&lt;/code&gt; command.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;$ echo &lt;span style="color:#e6db74"&gt;&amp;#39;test&amp;#39;&lt;/span&gt; | rev
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;tset
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;It also works with files.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;$ rev Procfile
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;br.amup/gifnoc C- amup cexe eldnub :bew
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</description></item><item><title>Run Previous Command</title><link>https://jakeworth.com/tils/run-previous-command/</link><pubDate>Wed, 21 Apr 2021 16:50:27 -0400</pubDate><guid>https://jakeworth.com/tils/run-previous-command/</guid><description>&lt;p&gt;Previously run commands can be viewed with the &lt;code&gt;history&lt;/code&gt; command.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;$ history
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#ae81ff"&gt;10048&lt;/span&gt; git checkout master
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#ae81ff"&gt;10049&lt;/span&gt; gpr
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#ae81ff"&gt;10050&lt;/span&gt; rake
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;With this list, you can rerun any command using &lt;code&gt;!n&lt;/code&gt;:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;$ !10048
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;Already on &lt;span style="color:#e6db74"&gt;&amp;#39;master&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The command &lt;code&gt;!!&lt;/code&gt; prints the last command you ran, then runs it. Here is an example:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;$ ls
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;LICENSE.md README.md bash cucumber rails
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;$ !!
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;ls
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;LICENSE.md README.md bash cucumber rails
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Replace the second &lt;code&gt;!&lt;/code&gt; with the first few letters of a command you have previously run, and bash will search for, print, and run the most recent instance.&lt;/p&gt;</description></item><item><title>Screen Flashing in OSX</title><link>https://jakeworth.com/tils/screen-flashing-in-osx/</link><pubDate>Wed, 21 Apr 2021 16:50:27 -0400</pubDate><guid>https://jakeworth.com/tils/screen-flashing-in-osx/</guid><description>&lt;p&gt;I like a quiet computer. But I also like tab-completing commands in the terminal, which produces a necessary alert from time to time.&lt;/p&gt;
&lt;p&gt;A solution I found today is to use OSX Accessibility features to add a screen flash on alerts, then disable the sounds.&lt;/p&gt;
&lt;p&gt;System Preferences &amp;gt; Accessibility &amp;gt; Hearing menu, choose &amp;lsquo;Audio&amp;rsquo; &amp;gt; Check &amp;lsquo;Flash the screen when an alert occurs&amp;rsquo;&lt;/p&gt;</description></item><item><title>Send Processes to the Background</title><link>https://jakeworth.com/tils/send-processes-to-the-background/</link><pubDate>Wed, 21 Apr 2021 16:50:27 -0400</pubDate><guid>https://jakeworth.com/tils/send-processes-to-the-background/</guid><description>&lt;p&gt;Processes on any POSIX-compliant computer can be sent to the background with &lt;code&gt;CTRL-Z&lt;/code&gt; (&lt;code&gt;&amp;lt;prefix&amp;gt; + Z&lt;/code&gt; for the tmux-ers) and returned to the foreground with &lt;code&gt;fg&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Here is an example:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;user@computer:~% ping www.google.com
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;PING www.google.com &lt;span style="color:#f92672"&gt;(&lt;/span&gt;74.125.228.212&lt;span style="color:#f92672"&gt;)&lt;/span&gt;: &lt;span style="color:#ae81ff"&gt;56&lt;/span&gt; data bytes
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#ae81ff"&gt;64&lt;/span&gt; bytes from 74.125.228.212: icmp_seq&lt;span style="color:#f92672"&gt;=&lt;/span&gt;&lt;span style="color:#ae81ff"&gt;0&lt;/span&gt; ttl&lt;span style="color:#f92672"&gt;=&lt;/span&gt;&lt;span style="color:#ae81ff"&gt;52&lt;/span&gt; time&lt;span style="color:#f92672"&gt;=&lt;/span&gt;41.574 ms
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#ae81ff"&gt;64&lt;/span&gt; bytes from 74.125.228.212: icmp_seq&lt;span style="color:#f92672"&gt;=&lt;/span&gt;&lt;span style="color:#ae81ff"&gt;1&lt;/span&gt; ttl&lt;span style="color:#f92672"&gt;=&lt;/span&gt;&lt;span style="color:#ae81ff"&gt;52&lt;/span&gt; time&lt;span style="color:#f92672"&gt;=&lt;/span&gt;42.836 ms
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#ae81ff"&gt;64&lt;/span&gt; bytes from 74.125.228.212: icmp_seq&lt;span style="color:#f92672"&gt;=&lt;/span&gt;&lt;span style="color:#ae81ff"&gt;2&lt;/span&gt; ttl&lt;span style="color:#f92672"&gt;=&lt;/span&gt;&lt;span style="color:#ae81ff"&gt;52&lt;/span&gt; time&lt;span style="color:#f92672"&gt;=&lt;/span&gt;53.527 ms
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;^Z
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;zsh: suspended ping www.google.com
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;user@computer:~% fg
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#f92672"&gt;[&lt;/span&gt;1&lt;span style="color:#f92672"&gt;]&lt;/span&gt; + continued ping www.google.com
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#ae81ff"&gt;64&lt;/span&gt; bytes from 74.125.228.212: icmp_seq&lt;span style="color:#f92672"&gt;=&lt;/span&gt;&lt;span style="color:#ae81ff"&gt;3&lt;/span&gt; ttl&lt;span style="color:#f92672"&gt;=&lt;/span&gt;&lt;span style="color:#ae81ff"&gt;52&lt;/span&gt; time&lt;span style="color:#f92672"&gt;=&lt;/span&gt;42.433 ms
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#ae81ff"&gt;64&lt;/span&gt; bytes from 74.125.228.212: icmp_seq&lt;span style="color:#f92672"&gt;=&lt;/span&gt;&lt;span style="color:#ae81ff"&gt;4&lt;/span&gt; ttl&lt;span style="color:#f92672"&gt;=&lt;/span&gt;&lt;span style="color:#ae81ff"&gt;52&lt;/span&gt; time&lt;span style="color:#f92672"&gt;=&lt;/span&gt;42.401 ms
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#ae81ff"&gt;64&lt;/span&gt; bytes from 74.125.228.212: icmp_seq&lt;span style="color:#f92672"&gt;=&lt;/span&gt;&lt;span style="color:#ae81ff"&gt;5&lt;/span&gt; ttl&lt;span style="color:#f92672"&gt;=&lt;/span&gt;&lt;span style="color:#ae81ff"&gt;52&lt;/span&gt; time&lt;span style="color:#f92672"&gt;=&lt;/span&gt;42.837 ms
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#ae81ff"&gt;64&lt;/span&gt; bytes from 74.125.228.212: icmp_seq&lt;span style="color:#f92672"&gt;=&lt;/span&gt;&lt;span style="color:#ae81ff"&gt;6&lt;/span&gt; ttl&lt;span style="color:#f92672"&gt;=&lt;/span&gt;&lt;span style="color:#ae81ff"&gt;52&lt;/span&gt; time&lt;span style="color:#f92672"&gt;=&lt;/span&gt;44.203 ms
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;^C
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;--- www.google.com ping statistics ---
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#ae81ff"&gt;7&lt;/span&gt; packets transmitted, &lt;span style="color:#ae81ff"&gt;7&lt;/span&gt; packets received, 0.0% packet loss
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</description></item><item><title>Start Postgres.app from the Command Line</title><link>https://jakeworth.com/tils/start-postgresapp-from-the-command-line/</link><pubDate>Wed, 21 Apr 2021 16:50:27 -0400</pubDate><guid>https://jakeworth.com/tils/start-postgresapp-from-the-command-line/</guid><description>&lt;p&gt;Today I was trying to restore a production Postgres dump on a remote machine, to test some migrations. I haven&amp;rsquo;t granted myself Heroku production database access, hence the SSH into a machine with a Heroku user that has access.&lt;/p&gt;
&lt;p&gt;I quickly hit a problem— this remote machine runs Postgres using &lt;a href="http://postgresapp.com/"&gt;Postgres.app&lt;/a&gt;. Without that program, I&amp;rsquo;m out of luck. No local Postgres server, no production database restore, no testing.&lt;/p&gt;
&lt;p&gt;It turns out you can start Postgres.app from the command line. Find the executable and call it.&lt;/p&gt;</description></item><item><title>Watch That Program</title><link>https://jakeworth.com/tils/watch-that-program/</link><pubDate>Wed, 21 Apr 2021 16:50:27 -0400</pubDate><guid>https://jakeworth.com/tils/watch-that-program/</guid><description>&lt;p&gt;Have you ever been working in the terminal and found yourself repeating the same command many times? Delegate that work to the computer.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;watch&lt;/code&gt; comes with Linux and can be installed on OSX via homebrew. It executes a program periodically, defaulting to every two seconds.&lt;/p&gt;
&lt;p&gt;We used it today while writing a database backup script. Instead of checking our dump directory every time a cron job executed, we ran &lt;code&gt;watch ls&lt;/code&gt;, and watched the script succeed or fail with live updates.&lt;/p&gt;</description></item></channel></rss>