<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Cli on Cheat Sheet</title><link>/tags/cli/</link><description>Recent content in Cli on Cheat Sheet</description><generator>Hugo</generator><language>en</language><lastBuildDate>Mon, 15 Jun 2026 00:00:00 +0000</lastBuildDate><atom:link href="/tags/cli/index.xml" rel="self" type="application/rss+xml"/><item><title>locate vs type vs which vs whereis</title><link>/linux/cli/locate-vs-type-vs-which-vs-whereis/</link><pubDate>Mon, 15 Jun 2026 00:00:00 +0000</pubDate><guid>/linux/cli/locate-vs-type-vs-which-vs-whereis/</guid><description>&lt;h1 id="locate-vs-type-vs-which-vs-whereis"&gt;&lt;code&gt;locate&lt;/code&gt; vs &lt;code&gt;type&lt;/code&gt; vs &lt;code&gt;which&lt;/code&gt; vs &lt;code&gt;whereis&lt;/code&gt;&lt;a class="anchor" href="#locate-vs-type-vs-which-vs-whereis"&gt;#&lt;/a&gt;&lt;/h1&gt;
&lt;p&gt;Comparison of different methods to locate commands and files in Linux.&lt;/p&gt;
&lt;h2 id="comparison"&gt;Comparison&lt;a class="anchor" href="#comparison"&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;type&lt;/code&gt;&lt;/strong&gt;: The most reliable way to determine what the shell will execute. Since it is a shell built-in, it identifies shell built-ins, aliases, and functions that external tools miss.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;which&lt;/code&gt;&lt;/strong&gt;: Locates an executable in the user&amp;rsquo;s &lt;code&gt;PATH&lt;/code&gt;. It does not show shell built-ins or aliases by default.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;whereis&lt;/code&gt;&lt;/strong&gt;: Locates the binary, source, and manual page files for a command. It searches a predefined list of standard directories.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;locate&lt;/code&gt;&lt;/strong&gt;: Searches a pre-built database (&lt;code&gt;mlocate.db&lt;/code&gt;) of the entire filesystem. It is extremely fast but may not find recently created files until the database is updated (typically via &lt;code&gt;updatedb&lt;/code&gt;).&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="usage"&gt;Usage&lt;a class="anchor" href="#usage"&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;h3 id="type"&gt;&lt;code&gt;type&lt;/code&gt;&lt;a class="anchor" href="#type"&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;-a&lt;/code&gt;&lt;/strong&gt;: Display all locations containing an executable named &lt;code&gt;&amp;lt;name&amp;gt;&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;-t&lt;/code&gt;&lt;/strong&gt;: Print a single word describing the type of the command (eg. &lt;code&gt;alias&lt;/code&gt;, &lt;code&gt;keyword&lt;/code&gt;, &lt;code&gt;function&lt;/code&gt;, &lt;code&gt;builtin&lt;/code&gt;, &lt;code&gt;file&lt;/code&gt;).&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="locate"&gt;&lt;code&gt;locate&lt;/code&gt;&lt;a class="anchor" href="#locate"&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;-i&lt;/code&gt;&lt;/strong&gt;: Ignore case distinctions.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;-r&lt;/code&gt;&lt;/strong&gt;: Search using a basic regular expression.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="examples"&gt;Examples&lt;a class="anchor" href="#examples"&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Identify command type&lt;/strong&gt;:
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="background-color:#f7f7f7;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;$ &lt;span style="color:#6639ba"&gt;type&lt;/span&gt; &lt;span style="color:#6639ba"&gt;cd&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#6639ba"&gt;cd&lt;/span&gt; is a shell builtin&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Show all locations&lt;/strong&gt;:
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="background-color:#f7f7f7;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;$ &lt;span style="color:#6639ba"&gt;type&lt;/span&gt; -a ls
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;ls is aliased to &lt;span style="color:#0a3069"&gt;`&lt;/span&gt;ls --color&lt;span style="color:#0550ae"&gt;=&lt;/span&gt;auto&lt;span style="color:#f6f8fa;background-color:#82071e"&gt;&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;ls is /usr/bin/ls&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Find binary and man page&lt;/strong&gt;:
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="background-color:#f7f7f7;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;$ whereis grep
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;grep: /usr/bin/grep /usr/share/man/man1/grep.1.gz&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Locate all files with a specific name&lt;/strong&gt;:
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="background-color:#f7f7f7;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;$ locate -i &amp;lt;filename&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;
&lt;/ul&gt;</description></item><item><title>make</title><link>/linux/cli/make/</link><pubDate>Mon, 15 Jun 2026 00:00:00 +0000</pubDate><guid>/linux/cli/make/</guid><description>&lt;h1 id="make"&gt;&lt;code&gt;make&lt;/code&gt;&lt;a class="anchor" href="#make"&gt;#&lt;/a&gt;&lt;/h1&gt;
&lt;h2 id="makefile-syntax"&gt;Makefile Syntax&lt;a class="anchor" href="#makefile-syntax"&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;A &lt;code&gt;Makefile&lt;/code&gt; consists of a set of rules. A rule has the following format:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="background-color:#f7f7f7;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-makefile" data-lang="makefile"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#6639ba"&gt;&amp;lt;target&amp;gt;&lt;/span&gt;&lt;span style="color:#0550ae"&gt;:&lt;/span&gt; &amp;lt;prerequisites&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;	&amp;lt;recipe&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Target&lt;/strong&gt;: Usually the name of a file generated by a program (eg. executables or objects). It can also be the name of an action to carry out (eg. &lt;code&gt;clean&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Prerequisites&lt;/strong&gt;: Files used as input to create the target. Multiple prerequisites are separated by spaces. A target is rebuilt if any of its prerequisites change.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Recipe&lt;/strong&gt;: Actions that &lt;code&gt;make&lt;/code&gt; carries out. &lt;strong&gt;Important:&lt;/strong&gt; Every recipe line must begin with a tab character.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="multiple-prerequisites-example"&gt;Multiple Prerequisites Example&lt;a class="anchor" href="#multiple-prerequisites-example"&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="background-color:#f7f7f7;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-makefile" data-lang="makefile"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#6639ba"&gt;main&lt;/span&gt;&lt;span style="color:#0550ae"&gt;:&lt;/span&gt; main.o utils.o
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;	gcc -o main main.o utils.o
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="special-targets-and-variables"&gt;Special Targets and Variables&lt;a class="anchor" href="#special-targets-and-variables"&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;h3 id="phony"&gt;&lt;code&gt;.PHONY&lt;/code&gt;&lt;a class="anchor" href="#phony"&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Defines targets that do not represent actual files. This prevents &lt;code&gt;make&lt;/code&gt; from failing to run a command if a file with the same name exists in the directory.&lt;/p&gt;</description></item><item><title>Go Tool</title><link>/programming/go/tool/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>/programming/go/tool/</guid><description>&lt;h1 id="go-tool"&gt;Go Tool&lt;a class="anchor" href="#go-tool"&gt;#&lt;/a&gt;&lt;/h1&gt;
&lt;h2 id="go-mod"&gt;&lt;code&gt;go mod&lt;/code&gt;&lt;a class="anchor" href="#go-mod"&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;go mod tidy&lt;/code&gt;: Scans code to sync &lt;code&gt;go.mod&lt;/code&gt;/&lt;code&gt;go.sum&lt;/code&gt;. Adds missing and removes unused dependencies; fixes &lt;code&gt;// indirect&lt;/code&gt; comments.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="go-get"&gt;&lt;code&gt;go get&lt;/code&gt;&lt;a class="anchor" href="#go-get"&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;$ go get ./...&lt;/code&gt;: Updates all dependencies in the module.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;$ go get &amp;lt;MODULE_PATH&amp;gt;&lt;/code&gt;: Adds/updates a specific module.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="go-list"&gt;&lt;code&gt;go list&lt;/code&gt;&lt;a class="anchor" href="#go-list"&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Lists packages in the module.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;-m&lt;/code&gt;: Lists modules instead.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;-versions&lt;/code&gt;: Reports available versions for a module.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;eg. &lt;code&gt;$ go list -m -versions github.com/spf13/cobra&lt;/code&gt;&lt;/p&gt;</description></item><item><title>lf</title><link>/dotfiles/lf/</link><pubDate>Sun, 24 May 2026 00:00:00 +0000</pubDate><guid>/dotfiles/lf/</guid><description>&lt;h1 id="lf"&gt;&lt;a href="https://github.com/gokcehan/lf"&gt;&lt;code&gt;lf&lt;/code&gt;&lt;/a&gt;&lt;a class="anchor" href="#lf"&gt;#&lt;/a&gt;&lt;/h1&gt;
&lt;h2 id="installation"&gt;Installation&lt;a class="anchor" href="#installation"&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;&lt;a href="https://github.com/gokcehan/lf#installation"&gt;https://github.com/gokcehan/lf#installation&lt;/a&gt;&lt;/p&gt;
&lt;h2 id="vim-compatible-interface"&gt;Vim-compatible Interface&lt;a class="anchor" href="#vim-compatible-interface"&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;&lt;code&gt;lf&lt;/code&gt; provides a Vim-like navigation experience by default:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Navigation:&lt;/strong&gt; &lt;code&gt;h&lt;/code&gt;, &lt;code&gt;j&lt;/code&gt;, &lt;code&gt;k&lt;/code&gt;, &lt;code&gt;l&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Scrolling:&lt;/strong&gt; &lt;code&gt;gg&lt;/code&gt;, &lt;code&gt;G&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Search:&lt;/strong&gt; &lt;code&gt;/&lt;/code&gt;, &lt;code&gt;n&lt;/code&gt;, &lt;code&gt;N&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Selection:&lt;/strong&gt; &lt;code&gt;v&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Hidden Files:&lt;/strong&gt; &lt;code&gt;zh&lt;/code&gt; (Toggle)&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="shortcuts"&gt;Shortcuts&lt;a class="anchor" href="#shortcuts"&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;m&lt;/code&gt;&lt;/strong&gt;: Set a mark (eg. &lt;code&gt;ma&lt;/code&gt; to mark a location as &amp;lsquo;a&amp;rsquo;).
&lt;ul&gt;
&lt;li&gt;Inspired by &lt;a href="../../dotfiles/vim/tips/marks/"&gt;Vim marks&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;'&lt;/code&gt;&lt;/strong&gt;: Move to a mark (eg. &lt;code&gt;'a&lt;/code&gt; to jump to the location marked &amp;lsquo;a&amp;rsquo;).
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;''&lt;/code&gt;&lt;/strong&gt;: Jump to previous location (built-in feature, also inspired by vim marks). Equivalent to &lt;code&gt;cd -&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;&amp;quot;&lt;/code&gt;&lt;/strong&gt;: Remove (Delete) the selected file or directory.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;gh&lt;/code&gt;&lt;/strong&gt;: Go home (cd &lt;code&gt;~&lt;/code&gt;).&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="shell-integration"&gt;Shell Integration&lt;a class="anchor" href="#shell-integration"&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;h3 id="change-directory-on-exit-lfcd"&gt;Change Directory on Exit (&lt;code&gt;lfcd&lt;/code&gt;)&lt;a class="anchor" href="#change-directory-on-exit-lfcd"&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;To make &lt;code&gt;lf&lt;/code&gt; change your shell&amp;rsquo;s current working directory to the last visited directory on exit, add the following to your &lt;code&gt;~/.bashrc&lt;/code&gt;: &lt;a href="https://github.com/Jssim710/dotfiles/blob/main/1-general/.bashrc_dotfiles#L17-L21"&gt;GitHub&lt;/a&gt;&lt;/p&gt;</description></item><item><title>awk</title><link>/linux/cli/awk/</link><pubDate>Sun, 24 May 2026 00:00:00 +0000</pubDate><guid>/linux/cli/awk/</guid><description>&lt;h1 id="awk"&gt;&lt;code&gt;awk&lt;/code&gt;&lt;a class="anchor" href="#awk"&gt;#&lt;/a&gt;&lt;/h1&gt;
&lt;blockquote class='book-hint '&gt;
&lt;p&gt;&amp;ldquo;Many, many people use &lt;code&gt;awk&lt;/code&gt; only to do one thing—to pick a single field out of an input stream.&amp;rdquo;&lt;/p&gt;
&lt;div style="text-align: right;"&gt;&lt;i&gt;How Linux Works 11.10.2&lt;/i&gt;&lt;/div&gt;
&lt;/blockquote&gt;&lt;h2 id="basic-usage"&gt;Basic Usage&lt;a class="anchor" href="#basic-usage"&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;h3 id="field-selection"&gt;Field Selection&lt;a class="anchor" href="#field-selection"&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Print specific columns using &lt;code&gt;$N&lt;/code&gt;.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="background-color:#f7f7f7;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#57606a"&gt;# Print the 5th field&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;ls -l &lt;span style="color:#1f2328"&gt;|&lt;/span&gt; awk &lt;span style="color:#0a3069"&gt;&amp;#39;{print $5}&amp;#39;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id="pattern-search"&gt;Pattern Search&lt;a class="anchor" href="#pattern-search"&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Filter lines matching a pattern before performing an action.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="background-color:#f7f7f7;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#57606a"&gt;# Print the 5th field of lines containing &amp;#34;log&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;ls -l &lt;span style="color:#1f2328"&gt;|&lt;/span&gt; awk &lt;span style="color:#0a3069"&gt;&amp;#39;/log/ {print $5}&amp;#39;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="built-in-variables"&gt;Built-in Variables&lt;a class="anchor" href="#built-in-variables"&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;h3 id="nr-number-of-records"&gt;&lt;code&gt;NR&lt;/code&gt; (Number of Records)&lt;a class="anchor" href="#nr-number-of-records"&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Represents the current line number.&lt;/p&gt;</description></item><item><title>curl</title><link>/network/cli/curl/</link><pubDate>Sun, 24 May 2026 00:00:00 +0000</pubDate><guid>/network/cli/curl/</guid><description>&lt;h1 id="curl"&gt;&lt;code&gt;curl&lt;/code&gt;&lt;a class="anchor" href="#curl"&gt;#&lt;/a&gt;&lt;/h1&gt;
&lt;h2 id="main-arguments"&gt;Main Arguments&lt;a class="anchor" href="#main-arguments"&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;-o, --output &amp;lt;file&amp;gt;&lt;/code&gt;&lt;/strong&gt;: Write output to a specific file.
&lt;ul&gt;
&lt;li&gt;Useful when the response is binary or too verbose to display in the terminal.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;cf. &lt;code&gt;wget&lt;/code&gt;&lt;/strong&gt;: &lt;code&gt;-O, --output-document&lt;/code&gt; is for the response body, while &lt;code&gt;-o, --output-file&lt;/code&gt; redirects log messages.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;-w, --write-out &amp;lt;format&amp;gt;&lt;/code&gt;&lt;/strong&gt;: Display information on stdout after a completed transfer.
&lt;ul&gt;
&lt;li&gt;Useful for extracting specific metadata like HTTP status codes. Refer to &lt;code&gt;man curl&lt;/code&gt; and search for &lt;code&gt;/-w&lt;/code&gt; or &lt;code&gt;/--write-out&lt;/code&gt; for the full list of variables.&lt;/li&gt;
&lt;li&gt;eg. &lt;code&gt;curl example.com -o /dev/null -w '%{http_code}\n'&lt;/code&gt;, Checks the HTTP status code without printing the response body.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="authn"&gt;AuthN&lt;a class="anchor" href="#authn"&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;blockquote class="book-hint info" &gt;
&lt;p&gt;The HTTP header is named &lt;code&gt;Authorization&lt;/code&gt;, but it is technically used for &lt;strong&gt;AuthN&lt;/strong&gt;—identifying who you are—rather than &lt;strong&gt;AuthZ&lt;/strong&gt;.&lt;/p&gt;</description></item><item><title>find</title><link>/linux/cli/find/</link><pubDate>Sun, 24 May 2026 00:00:00 +0000</pubDate><guid>/linux/cli/find/</guid><description>&lt;h1 id="find"&gt;&lt;code&gt;find&lt;/code&gt;&lt;a class="anchor" href="#find"&gt;#&lt;/a&gt;&lt;/h1&gt;
&lt;h3 id="general-usage"&gt;General Usage&lt;a class="anchor" href="#general-usage"&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="background-color:#f7f7f7;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;find &amp;lt;path&amp;gt; &amp;lt;expression&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id="common-flags"&gt;Common Flags&lt;a class="anchor" href="#common-flags"&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;-name&lt;/code&gt;&lt;/strong&gt;: Search by filename pattern (eg. &lt;code&gt;-name '*.log'&lt;/code&gt;). Single quotes are recommended to prevent the shell from expanding wildcards prematurely.
&lt;ul&gt;
&lt;li&gt;&lt;a href="../../linux/shell/process-order/"&gt;Shell Processing Order&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;-type&lt;/code&gt;&lt;/strong&gt;: Filter by file type
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;f&lt;/code&gt;: file&lt;/li&gt;
&lt;li&gt;&lt;code&gt;d&lt;/code&gt;: directory&lt;/li&gt;
&lt;li&gt;&lt;code&gt;l&lt;/code&gt;: symbolic link&lt;/li&gt;
&lt;li&gt;&lt;code&gt;s&lt;/code&gt;: socket&lt;/li&gt;
&lt;li&gt;&lt;code&gt;p&lt;/code&gt;: named pipe (FIFO)&lt;/li&gt;
&lt;li&gt;&lt;code&gt;b&lt;/code&gt;: block device&lt;/li&gt;
&lt;li&gt;&lt;code&gt;c&lt;/code&gt;: character device&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;-print&lt;/code&gt;&lt;/strong&gt;: Display results to standard output (default).&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;-print0&lt;/code&gt;&lt;/strong&gt;: Separate results with a null character (&lt;code&gt;\0&lt;/code&gt;). Useful for filenames with spaces.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;-exec&lt;/code&gt;&lt;/strong&gt;: Execute a command on the search results.
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;\;&lt;/code&gt; (Individual Execution):&lt;/strong&gt; Runs the command once for each result. The semicolon must be escaped (&lt;code&gt;\;&lt;/code&gt;) because it is a shell reserved character.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;+&lt;/code&gt; (Batch Execution):&lt;/strong&gt; Collects results and runs the command once with multiple arguments (similar to &lt;code&gt;xargs&lt;/code&gt;). Better for performance.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;</description></item><item><title>grep</title><link>/linux/cli/grep/</link><pubDate>Sun, 24 May 2026 00:00:00 +0000</pubDate><guid>/linux/cli/grep/</guid><description>&lt;h1 id="grep"&gt;&lt;code&gt;grep&lt;/code&gt;&lt;a class="anchor" href="#grep"&gt;#&lt;/a&gt;&lt;/h1&gt;
&lt;h3 id="general-usage"&gt;General Usage&lt;a class="anchor" href="#general-usage"&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="background-color:#f7f7f7;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;grep &amp;lt;options&amp;gt; &amp;lt;pattern&amp;gt; &amp;lt;file&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id="common-flags"&gt;Common Flags&lt;a class="anchor" href="#common-flags"&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;-i, --ignore-case&lt;/code&gt;&lt;/strong&gt;: Ignore case distinctions.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;-v, --invert-match&lt;/code&gt;&lt;/strong&gt;: Invert the sense of matching, selecting non-matching lines.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;-l, --files-with-matches&lt;/code&gt;&lt;/strong&gt;: Print only the names of files with matching lines.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;-q, --quiet, --silent&lt;/code&gt;&lt;/strong&gt;: Do not write anything to standard output. Exit immediately with zero status if any match is found.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;-n, --line-number&lt;/code&gt;&lt;/strong&gt;: Prefix each line of output with its 1-based line number.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;-E, --extended-regexp&lt;/code&gt;&lt;/strong&gt;: Interpret patterns as extended regular expressions (ERE).
&lt;ul&gt;
&lt;li&gt;eg. &lt;code&gt;grep -E '&amp;lt;pattern1&amp;gt;|&amp;lt;pattern2&amp;gt;|...' &amp;lt;file&amp;gt;&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;-r, --recursive&lt;/code&gt;&lt;/strong&gt;: Read all files under each directory, recursively.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;-A &amp;lt;num&amp;gt;, --after-context=&amp;lt;num&amp;gt;&lt;/code&gt;&lt;/strong&gt;: Print &lt;code&gt;&amp;lt;num&amp;gt;&lt;/code&gt; lines of trailing context after matching lines.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;-B &amp;lt;num&amp;gt;, --before-context=&amp;lt;num&amp;gt;&lt;/code&gt;&lt;/strong&gt;: Print &lt;code&gt;&amp;lt;num&amp;gt;&lt;/code&gt; lines of leading context before matching lines.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;-C &amp;lt;num&amp;gt;, --context=&amp;lt;num&amp;gt;&lt;/code&gt;&lt;/strong&gt;: Print &lt;code&gt;&amp;lt;num&amp;gt;&lt;/code&gt; lines of output context.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="posix-character-classes"&gt;POSIX Character Classes&lt;a class="anchor" href="#posix-character-classes"&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Used within bracket expressions &lt;code&gt;[ ]&lt;/code&gt;.&lt;/p&gt;</description></item><item><title>pgrep</title><link>/linux/cli/pgrep/</link><pubDate>Sun, 24 May 2026 00:00:00 +0000</pubDate><guid>/linux/cli/pgrep/</guid><description>&lt;h1 id="pgrep"&gt;&lt;code&gt;pgrep&lt;/code&gt;&lt;a class="anchor" href="#pgrep"&gt;#&lt;/a&gt;&lt;/h1&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;-l&lt;/code&gt;&lt;/strong&gt;: List the process name in addition to the PID.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;-a&lt;/code&gt;&lt;/strong&gt;: List the full command line in addition to the PID.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;-u&lt;/code&gt;&lt;/strong&gt;: Select only processes whose effective user ID is listed.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;-f&lt;/code&gt;&lt;/strong&gt;: Match the pattern against the full command line (not just the process name).&lt;/li&gt;
&lt;/ul&gt;</description></item><item><title>ps</title><link>/linux/cli/ps/</link><pubDate>Sun, 24 May 2026 00:00:00 +0000</pubDate><guid>/linux/cli/ps/</guid><description>&lt;h1 id="ps"&gt;&lt;code&gt;ps&lt;/code&gt;&lt;a class="anchor" href="#ps"&gt;#&lt;/a&gt;&lt;/h1&gt;
&lt;p&gt;&lt;strong&gt;P&lt;/strong&gt;rocess &lt;strong&gt;S&lt;/strong&gt;tatus&lt;/p&gt;
&lt;h2 id="styles"&gt;Styles&lt;a class="anchor" href="#styles"&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;h3 id="bsd-style-aux"&gt;BSD Style (&lt;code&gt;aux&lt;/code&gt;)&lt;a class="anchor" href="#bsd-style-aux"&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Does not use a dash before options.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;a&lt;/code&gt;&lt;/strong&gt;: Show processes for all users.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;u&lt;/code&gt;&lt;/strong&gt;: Display the process&amp;rsquo;s user/owner and detailed info, eg. CPU, Memory.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;x&lt;/code&gt;&lt;/strong&gt;: Show processes not attached to a terminal TTY.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;w&lt;/code&gt;&lt;/strong&gt;: Wide output. Use twice (&lt;code&gt;-ww&lt;/code&gt;) for unlimited width.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;p&lt;/code&gt;&lt;/strong&gt;: Select by process ID PID.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="dash-style--ef"&gt;Dash Style (&lt;code&gt;-ef&lt;/code&gt;)&lt;a class="anchor" href="#dash-style--ef"&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Standard UNIX options.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;-e&lt;/code&gt;&lt;/strong&gt;: Select all processes.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;-f&lt;/code&gt;&lt;/strong&gt;: Full-format listing.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;-o&lt;/code&gt;&lt;/strong&gt;: User-defined format.
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;comm&lt;/code&gt;: Command name only.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;args&lt;/code&gt;: Command with all its arguments.&lt;/li&gt;
&lt;li&gt;eg. &lt;code&gt;ps -ef -o pid,comm,args&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;-w&lt;/code&gt;&lt;/strong&gt;: Wide output.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;-ww&lt;/code&gt;&lt;/strong&gt;: Unlimited width.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;-p&lt;/code&gt;&lt;/strong&gt;: Select by PID.&lt;/li&gt;
&lt;/ul&gt;</description></item><item><title>pstree</title><link>/linux/cli/pstree/</link><pubDate>Sun, 24 May 2026 00:00:00 +0000</pubDate><guid>/linux/cli/pstree/</guid><description>&lt;h1 id="pstree"&gt;&lt;code&gt;pstree&lt;/code&gt;&lt;a class="anchor" href="#pstree"&gt;#&lt;/a&gt;&lt;/h1&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;-p&lt;/code&gt;&lt;/strong&gt;: Show PIDs.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;-a&lt;/code&gt;&lt;/strong&gt;: Show command line arguments.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;-h&lt;/code&gt;&lt;/strong&gt;: Highlight the current process and its ancestors.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;-u&lt;/code&gt;&lt;/strong&gt;: Show user transitions (when the user differs from the parent).&lt;/li&gt;
&lt;/ul&gt;</description></item><item><title>xargs</title><link>/linux/cli/xargs/</link><pubDate>Sun, 24 May 2026 00:00:00 +0000</pubDate><guid>/linux/cli/xargs/</guid><description>&lt;h1 id="xargs"&gt;&lt;code&gt;xargs&lt;/code&gt;&lt;a class="anchor" href="#xargs"&gt;#&lt;/a&gt;&lt;/h1&gt;
&lt;h3 id="xargs-with-"&gt;&lt;code&gt;xargs&lt;/code&gt; with &lt;code&gt;{}&lt;/code&gt;&lt;a class="anchor" href="#xargs-with-"&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;Use &lt;code&gt;-I {}&lt;/code&gt; to define a placeholder (&lt;code&gt;{}&lt;/code&gt;) for the input, allowing you to place the argument anywhere in the command.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="background-color:#f7f7f7;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;&lt;span style="color:#57606a"&gt;# Rename all .txt files to .bak&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;ls *.txt &lt;span style="color:#1f2328"&gt;|&lt;/span&gt; xargs -I &lt;span style="color:#0550ae"&gt;{}&lt;/span&gt; mv &lt;span style="color:#0550ae"&gt;{}&lt;/span&gt; &lt;span style="color:#0550ae"&gt;{}&lt;/span&gt;.bak&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</description></item></channel></rss>