<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Shell &amp; command line on Benjamin Italiaander</title><link>https://tlnd.org/topic/shell/</link><description>Recent content in Shell &amp; command line on Benjamin Italiaander</description><generator>Hugo</generator><language>en</language><lastBuildDate>Sat, 28 Nov 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://tlnd.org/topic/shell/index.xml" rel="self" type="application/rss+xml"/><item><title>Local AI with Ollama</title><link>https://tlnd.org/Linux/ai/</link><pubDate>Sat, 28 Nov 2026 00:00:00 +0000</pubDate><guid>https://tlnd.org/Linux/ai/</guid><description>&lt;h1 id="-local-ai-with-ollama"&gt;🤖 Local AI with Ollama&lt;/h1&gt;
&lt;p&gt;&lt;a href="https://ollama.com/" class="external-link" target="_blank" rel="noopener"&gt;Ollama&lt;/a&gt; runs large language models (LLMs) on your own computer. Nothing you type leaves your machine, it works offline, and it costs nothing per question. I use it for quick questions and for code.&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id="1-install"&gt;1. Install&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;curl -fsSL https://ollama.com/install.sh &lt;span class="p"&gt;|&lt;/span&gt; sh
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This installs &lt;code&gt;ollama&lt;/code&gt; and a systemd service that listens on &lt;code&gt;http://localhost:11434&lt;/code&gt;. With an NVIDIA or AMD graphics card it uses the GPU automatically.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;systemctl status ollama
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;ollama --version
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="2-get-a-model-and-talk-to-it"&gt;2. Get a model and talk to it&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;ollama pull qwen3:8b &lt;span class="c1"&gt;# download a model (about 5 GB)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;ollama run qwen3:8b &lt;span class="c1"&gt;# chat in the terminal; /bye to stop&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;ollama run qwen3:8b &lt;span class="s2"&gt;&amp;#34;Explain what a TOTP code is in two sentences.&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;ollama list &lt;span class="c1"&gt;# models on disk&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;ollama ps &lt;span class="c1"&gt;# models in memory, and whether they run on the GPU&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;ollama rm ministral-3:3b &lt;span class="c1"&gt;# remove a model&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="3-which-model-fits"&gt;3. Which model fits?&lt;/h2&gt;
&lt;p&gt;The model has to fit in your &lt;strong&gt;video memory (VRAM)&lt;/strong&gt;, otherwise it runs (much slower) on the CPU. A rough guide for the usual 4-bit models:&lt;/p&gt;</description></item><item><title>Linux Networking Cheatsheet: ip, nmcli, DNS and WireGuard</title><link>https://tlnd.org/Linux/networking/</link><pubDate>Sat, 28 Nov 2026 00:00:00 +0000</pubDate><guid>https://tlnd.org/Linux/networking/</guid><description>&lt;h1 id="-linux-networking-cheatsheet"&gt;🌐 Linux networking cheatsheet&lt;/h1&gt;
&lt;p&gt;&lt;code&gt;ifconfig&lt;/code&gt;, &lt;code&gt;route&lt;/code&gt; and &lt;code&gt;netstat&lt;/code&gt; are old; on current Linux systems you use &lt;strong&gt;&lt;code&gt;ip&lt;/code&gt;&lt;/strong&gt;, &lt;strong&gt;&lt;code&gt;ss&lt;/code&gt;&lt;/strong&gt; and &lt;strong&gt;&lt;code&gt;nmcli&lt;/code&gt;&lt;/strong&gt;.&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id="addresses-links-and-routes-ip"&gt;Addresses, links and routes: ip&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;ip -br a &lt;span class="c1"&gt;# all interfaces and addresses, one line each&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;ip a show dev eth0 &lt;span class="c1"&gt;# one interface, in detail&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;ip -br link &lt;span class="c1"&gt;# link state (UP/DOWN) and MAC addresses&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;ip r &lt;span class="c1"&gt;# routing table (IPv4)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;ip -6 r &lt;span class="c1"&gt;# routing table (IPv6)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;ip route get 1.1.1.1 &lt;span class="c1"&gt;# which interface and gateway are used for this address?&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;ip neigh &lt;span class="c1"&gt;# ARP / neighbour table: who is on the local network&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;ip -s link show dev eth0 &lt;span class="c1"&gt;# packet counters and errors&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Temporary changes (gone after a reboot):&lt;/p&gt;</description></item><item><title>systemd Basics: Services, Logs and Timers</title><link>https://tlnd.org/Linux/systemd/</link><pubDate>Sat, 28 Nov 2026 00:00:00 +0000</pubDate><guid>https://tlnd.org/Linux/systemd/</guid><description>&lt;h1 id="-systemd-basics"&gt;⚙️ systemd basics&lt;/h1&gt;
&lt;p&gt;systemd starts and watches everything on a modern Linux system: services, timers, mounts, and the logs. Two commands do almost everything: &lt;strong&gt;&lt;code&gt;systemctl&lt;/code&gt;&lt;/strong&gt; and &lt;strong&gt;&lt;code&gt;journalctl&lt;/code&gt;&lt;/strong&gt;.&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id="services-with-systemctl"&gt;Services with systemctl&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;systemctl status nginx &lt;span class="c1"&gt;# is it running? last log lines&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;sudo systemctl start nginx &lt;span class="c1"&gt;# start now&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;sudo systemctl stop nginx &lt;span class="c1"&gt;# stop now&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;sudo systemctl restart nginx &lt;span class="c1"&gt;# stop + start&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;sudo systemctl reload nginx &lt;span class="c1"&gt;# re-read the config without stopping (if supported)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;sudo systemctl &lt;span class="nb"&gt;enable&lt;/span&gt; --now nginx &lt;span class="c1"&gt;# start now AND at every boot&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;sudo systemctl disable --now nginx &lt;span class="c1"&gt;# stop now and don&amp;#39;t start at boot&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;systemctl is-enabled nginx &lt;span class="c1"&gt;# enabled / disabled&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;systemctl --failed &lt;span class="c1"&gt;# everything that went wrong&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;systemctl list-units --type&lt;span class="o"&gt;=&lt;/span&gt;service &lt;span class="c1"&gt;# all loaded services&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Change a setting of a service without editing the original file (it is overwritten by updates):&lt;/p&gt;</description></item><item><title>Generate a QR code from a pipe in the Linux CLI</title><link>https://tlnd.org/Linux/cli/qrcode/</link><pubDate>Mon, 01 Jan 2024 00:00:00 +0000</pubDate><guid>https://tlnd.org/Linux/cli/qrcode/</guid><description>&lt;h1 id="create-a-qr-code-from-command-output"&gt;Create a QR code from command output&lt;/h1&gt;
&lt;p&gt;I needed to turn the output of a command into a QR code. Here is a short guide on how to generate a QR code from a pipe in the Linux CLI:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;qrencode -t ansiutf8 &amp;lt; ./somefile.txt
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;I manage my passwords with &lt;code&gt;pass&lt;/code&gt; and wanted to get a password onto my phone with a QR code:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;pass work/someaccount &lt;span class="p"&gt;|&lt;/span&gt; head -n1 &lt;span class="p"&gt;|&lt;/span&gt; tr -d &lt;span class="s1"&gt;&amp;#39;\n&amp;#39;&lt;/span&gt; &lt;span class="p"&gt;|&lt;/span&gt; qrencode -t ansiutf8
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;code&gt;tr&lt;/code&gt; removes the newline that is added at the end.&lt;/p&gt;</description></item><item><title>Benchmark write speed</title><link>https://tlnd.org/Linux/benchmark/</link><pubDate>Mon, 27 Feb 2023 14:12:45 +0100</pubDate><guid>https://tlnd.org/Linux/benchmark/</guid><description>&lt;h1 id="-benchmark-write-speed-to-a-disk"&gt;💾 Benchmark Write Speed to a Disk&lt;/h1&gt;
&lt;p&gt;Sometimes you need to test how fast a (network) disk can handle writes.&lt;/p&gt;
&lt;p&gt;A common method is:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Write &lt;strong&gt;one large file&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Split it into &lt;strong&gt;many small files&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Benchmark copying them using &lt;code&gt;rsync&lt;/code&gt; or &lt;code&gt;cp&lt;/code&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Why?
Some storage systems handle large sequential writes very well, but struggle with many small files (metadata overhead, IOPS limits, etc.).&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id="1-create-a-large-random-file"&gt;1️⃣ Create a Large Random File&lt;/h2&gt;
&lt;p&gt;Generate a large file locally:&lt;/p&gt;</description></item><item><title>Date command in bash</title><link>https://tlnd.org/Linux/bash_tricks/date_command/</link><pubDate>Mon, 27 Feb 2023 14:12:45 +0100</pubDate><guid>https://tlnd.org/Linux/bash_tricks/date_command/</guid><description>&lt;h1 id="a-few-small-examples-of-the-date-command"&gt;A few small examples of the date command&lt;/h1&gt;
&lt;p&gt;Show the day of the week as a number (1 = Monday), which is always handy to know:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;date +%u
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Show the quarter of the year:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;date +%q
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;In a script:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="cp"&gt;#!/bin/bash
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;todayWeekday&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="k"&gt;$(&lt;/span&gt;date +%u&lt;span class="k"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;todayQuarter&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="k"&gt;$(&lt;/span&gt;date +%q&lt;span class="k"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;Today is weekday &lt;/span&gt;&lt;span class="nv"&gt;$todayWeekday&lt;/span&gt;&lt;span class="s2"&gt;, in quarter &lt;/span&gt;&lt;span class="nv"&gt;$todayQuarter&lt;/span&gt;&lt;span class="s2"&gt; of the year.&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</description></item><item><title>Kitty Terminal: My Working Config</title><link>https://tlnd.org/Linux/cli/kitty_terminal/</link><pubDate>Mon, 27 Feb 2023 14:12:45 +0100</pubDate><guid>https://tlnd.org/Linux/cli/kitty_terminal/</guid><description>&lt;blockquote&gt;
&lt;p&gt;📦 &lt;em&gt;This page comes from my GitHub repository &lt;a href="https://github.com/Benjamin-Italiaander/kitty_terminal_working_config_example" class="external-link" target="_blank" rel="noopener"&gt;kitty_terminal_working_config_example&lt;/a&gt; and is updated automatically when I change it there.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h1 id="-kitty-terminal-my-working-config"&gt;🐱 Kitty Terminal: My Working Config&lt;/h1&gt;
&lt;p&gt;&lt;a href="https://sw.kovidgoyal.net/kitty/" class="external-link" target="_blank" rel="noopener"&gt;kitty&lt;/a&gt; is a fast, GPU-accelerated terminal for Linux and macOS. I switched to it from GNOME Terminal + &lt;a href="https://zellij.dev/" class="external-link" target="_blank" rel="noopener"&gt;Zellij&lt;/a&gt;, because kitty does everything I used a multiplexer for (tabs, splits, layouts) and a lot more: it shows images, makes file names clickable, and has small built-in tools called &lt;strong&gt;kittens&lt;/strong&gt;.&lt;/p&gt;</description></item><item><title>Count logged-in users</title><link>https://tlnd.org/Linux/bash_tricks/display_number_of_loggedin_users/</link><pubDate>Fri, 01 Jan 2021 00:00:00 +0000</pubDate><guid>https://tlnd.org/Linux/bash_tricks/display_number_of_loggedin_users/</guid><description>&lt;h1 id="display-the-number-of-logged-in-users-with-the-who-command"&gt;Display the number of logged-in users with the who command&lt;/h1&gt;
&lt;p&gt;Keeping track of the number of users logged into a system can be very useful. This short Bash command shows the exact number of active users:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;who -q &lt;span class="p"&gt;|&lt;/span&gt; grep &lt;span class="s2"&gt;&amp;#34;users=&amp;#34;&lt;/span&gt; &lt;span class="p"&gt;|&lt;/span&gt; sed &lt;span class="s1"&gt;&amp;#39;s/# users=//g&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;For a continuous, real-time update of the user count, run it with &lt;code&gt;watch&lt;/code&gt;:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;watch &lt;span class="s2"&gt;&amp;#34;who -q | grep &amp;#39;users=&amp;#39; | sed &amp;#39;s/# users=//g&amp;#39;&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</description></item><item><title>Read Markdown in the CLI</title><link>https://tlnd.org/Linux/cli/read_markdown_in_cli/</link><pubDate>Tue, 22 Nov 2016 00:00:00 +0000</pubDate><guid>https://tlnd.org/Linux/cli/read_markdown_in_cli/</guid><description>&lt;h1 id="reading-markdown-files-on-the-linux-command-line"&gt;Reading Markdown files on the Linux command line&lt;/h1&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/charmbracelet/glow" class="external-link" target="_blank" rel="noopener"&gt;Glow&lt;/a&gt;: a handy tool I came across. Well maintained and easy to use.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/Textualize/frogmouth" class="external-link" target="_blank" rel="noopener"&gt;Frogmouth&lt;/a&gt;: a simple Markdown viewer for the CLI, built with &lt;a href="https://github.com/Textualize/textual" class="external-link" target="_blank" rel="noopener"&gt;Textual&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/ttscoff/mdless" class="external-link" target="_blank" rel="noopener"&gt;mdless&lt;/a&gt;: doesn&amp;rsquo;t look like it is maintained regularly, but it renders Markdown files nicely in the CLI.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/markdownlint/markdownlint" class="external-link" target="_blank" rel="noopener"&gt;Markdown lint tool&lt;/a&gt;: for the Markdown purists, a tool to check your Markdown files. Not well maintained.&lt;/li&gt;
&lt;/ul&gt;</description></item><item><title>Allow a User to Access Serial (TTY) Devices</title><link>https://tlnd.org/Linux/bash_tricks/allow_tty/</link><pubDate>Mon, 14 Nov 2016 00:00:00 +0000</pubDate><guid>https://tlnd.org/Linux/bash_tricks/allow_tty/</guid><description>&lt;h1 id="allow-a-user-to-access-serial-tty-devices"&gt;Allow a user to access serial (TTY) devices&lt;/h1&gt;
&lt;p&gt;On Ubuntu, create the user and add them to the &lt;code&gt;dialout&lt;/code&gt; group. &lt;code&gt;dialout&lt;/code&gt; normally grants access to serial devices such as &lt;code&gt;/dev/ttyUSB0&lt;/code&gt;, &lt;code&gt;/dev/ttyACM0&lt;/code&gt; and &lt;code&gt;/dev/ttyS0&lt;/code&gt;.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# Create the user&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;sudo adduser username
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# Allow access to serial/TTY devices&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;sudo usermod -aG dialout username
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Check:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;groups username
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;You should see something like:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;username : username dialout
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The user needs to &lt;strong&gt;log out and back in&lt;/strong&gt; before the new group membership takes effect.&lt;/p&gt;</description></item><item><title>Copy and Paste in the CLI</title><link>https://tlnd.org/Linux/cli/copy-and-paste-in-cli/</link><pubDate>Thu, 03 Nov 2016 00:00:00 +0000</pubDate><guid>https://tlnd.org/Linux/cli/copy-and-paste-in-cli/</guid><description>&lt;h1 id="copying-and-pasting-in-the-linux-terminal-is-easy-with-xclip"&gt;Copying and pasting in the Linux terminal is easy with xclip&lt;/h1&gt;
&lt;h3 id="a-simple-command"&gt;A simple command&lt;/h3&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# Copy whatever is piped in to the clipboard&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;xclip -selection c
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id="making-it-a-function"&gt;Making it a function&lt;/h3&gt;
&lt;p&gt;I keep forgetting the command, so I added a function to my &lt;code&gt;.bashrc&lt;/code&gt;:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# Use it by piping something into copy-to-clipboard&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;copy-to-clipboard&lt;span class="o"&gt;()&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; xclip -selection c
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# For example:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;cat some-file.txt &lt;span class="p"&gt;|&lt;/span&gt; copy-to-clipboard
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id="on-wayland"&gt;On Wayland&lt;/h3&gt;
&lt;p&gt;&lt;code&gt;xclip&lt;/code&gt; only works with X11. Most desktops (GNOME on Fedora and Ubuntu) now use &lt;strong&gt;Wayland&lt;/strong&gt;, where you need &lt;code&gt;wl-copy&lt;/code&gt; from the &lt;code&gt;wl-clipboard&lt;/code&gt; package:&lt;/p&gt;</description></item><item><title>ImageMagick</title><link>https://tlnd.org/Linux/cli/ImageMagick/</link><pubDate>Mon, 10 Oct 2016 00:00:00 +0000</pubDate><guid>https://tlnd.org/Linux/cli/ImageMagick/</guid><description>&lt;h1 id="using-imagemagick"&gt;Using ImageMagick&lt;/h1&gt;
&lt;p&gt;If you ever need to do some quick image or document conversions, ImageMagick is a command-line tool that can save you a ton of time. Here&amp;rsquo;s a quick guide on how to install it and use it to convert images, PDFs and more. Perfect for automating repetitive tasks.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;💡 In ImageMagick 7 the &lt;code&gt;convert&lt;/code&gt; command is called &lt;code&gt;magick&lt;/code&gt; (e.g. &lt;code&gt;magick input.psd output.jpg&lt;/code&gt;). &lt;code&gt;convert&lt;/code&gt; still works but is deprecated.&lt;/p&gt;</description></item><item><title>Put every word on its own line</title><link>https://tlnd.org/Linux/cli/remove-blank-spaces/</link><pubDate>Tue, 04 Oct 2016 00:00:00 +0000</pubDate><guid>https://tlnd.org/Linux/cli/remove-blank-spaces/</guid><description>&lt;h1 id="put-every-word-on-its-own-line"&gt;Put every word on its own line&lt;/h1&gt;
&lt;p&gt;If you have a file with text like this:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;abcd efdg ijklm sfgsdf
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;sdgf gfgf gdfg dgdffdg
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;and you want each word on a separate line, the easiest way is &lt;code&gt;xargs&lt;/code&gt;:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;xargs -n &lt;span class="m"&gt;1&lt;/span&gt; &amp;lt; ./somefile.txt
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</description></item><item><title>Find Files, Excluding Hidden Files</title><link>https://tlnd.org/Linux/find_exclude_hidden_files/</link><pubDate>Tue, 20 Sep 2016 00:00:00 +0000</pubDate><guid>https://tlnd.org/Linux/find_exclude_hidden_files/</guid><description>&lt;h2 id="find-files-and-ignore-hidden--files"&gt;Find files and ignore hidden (&lt;code&gt;.*&lt;/code&gt;) files&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;find /home/user ! -path &lt;span class="s1"&gt;&amp;#39;*/.*&amp;#39;&lt;/span&gt; -type f
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;ul&gt;
&lt;li&gt;Replace &lt;code&gt;/home/user&lt;/code&gt; with the folder you want to search.&lt;/li&gt;
&lt;li&gt;Change &lt;code&gt;-type f&lt;/code&gt; (files) to &lt;code&gt;-type d&lt;/code&gt; to find directories instead.&lt;/li&gt;
&lt;/ul&gt;</description></item><item><title>Linux CLI Cheatsheet (Daily Use)</title><link>https://tlnd.org/Linux/cheatsheet_bash/</link><pubDate>Sun, 07 Aug 2016 00:00:00 +0000</pubDate><guid>https://tlnd.org/Linux/cheatsheet_bash/</guid><description>&lt;h1 id="-linux-cli-cheatsheet-daily-use"&gt;🧠 Linux CLI Cheatsheet (Daily Use)&lt;/h1&gt;
&lt;h2 id="-search-in-history"&gt;🔎 Search in History&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Ctrl + r &lt;span class="c1"&gt;# Reverse search (type to search, keep pressing for older matches)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Ctrl + s &lt;span class="c1"&gt;# Forward search (often disabled by default)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;history&lt;/span&gt; &lt;span class="c1"&gt;# Show command history&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;history&lt;/span&gt; &lt;span class="p"&gt;|&lt;/span&gt; grep ssh &lt;span class="c1"&gt;# Search history with grep&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;!123 &lt;span class="c1"&gt;# Run command number 123 from history&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;!! &lt;span class="c1"&gt;# Run last command&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;!ssh &lt;span class="c1"&gt;# Run last command starting with &amp;#34;ssh&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;hr&gt;
&lt;h2 id="-cursor-movement-super-useful"&gt;✏️ Cursor Movement (SUPER useful)&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Ctrl + a &lt;span class="c1"&gt;# Go to beginning of line&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Ctrl + e &lt;span class="c1"&gt;# Go to end of line&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Alt + b &lt;span class="c1"&gt;# Move back one word&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Alt + f &lt;span class="c1"&gt;# Move forward one word&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Ctrl + x Ctrl + x &lt;span class="c1"&gt;# Jump between start of line and cursor&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Alt + . &lt;span class="c1"&gt;# Insert the last argument of the previous command (press again for older ones)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;hr&gt;
&lt;h2 id="-editing--deleting"&gt;✂️ Editing &amp;amp; Deleting&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Ctrl + u &lt;span class="c1"&gt;# Delete from cursor → start&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Ctrl + k &lt;span class="c1"&gt;# Delete from cursor → end&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Ctrl + w &lt;span class="c1"&gt;# Delete previous word&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Ctrl + d &lt;span class="c1"&gt;# Delete character under cursor&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Ctrl + h &lt;span class="c1"&gt;# Delete character before cursor (backspace)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Ctrl + y &lt;span class="c1"&gt;# Paste last deleted text (yank)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Ctrl + _ &lt;span class="c1"&gt;# Undo the last edit&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;hr&gt;
&lt;h2 id="-clear-screen--reset"&gt;🧹 Clear Screen / Reset&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Ctrl + l &lt;span class="c1"&gt;# Clear screen (same as &amp;#39;clear&amp;#39;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;clear &lt;span class="c1"&gt;# Clear screen&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;reset &lt;span class="c1"&gt;# Full terminal reset (fix broken terminal)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;hr&gt;
&lt;h2 id="-process-control"&gt;⏸️ Process Control&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Ctrl + c &lt;span class="c1"&gt;# Stop current command&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Ctrl + z &lt;span class="c1"&gt;# Pause (stop) the command; continue it with fg or bg&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;fg&lt;/span&gt; &lt;span class="c1"&gt;# Bring back to foreground&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;bg&lt;/span&gt; &lt;span class="c1"&gt;# Resume in background&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;jobs&lt;/span&gt; &lt;span class="c1"&gt;# List background jobs&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;hr&gt;
&lt;h2 id="-navigation--basics"&gt;📁 Navigation &amp;amp; Basics&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; - &lt;span class="c1"&gt;# Go to previous directory&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;pwd&lt;/span&gt; &lt;span class="c1"&gt;# Show current directory&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;ls -lah &lt;span class="c1"&gt;# List files (detailed + human readable)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;tree &lt;span class="c1"&gt;# Show directory structure (if installed)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;hr&gt;
&lt;h2 id="-handy-shortcuts"&gt;⚡ Handy Shortcuts&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Tab &lt;span class="c1"&gt;# Auto-complete files/commands&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Tab Tab &lt;span class="c1"&gt;# Show all possibilities&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Ctrl + p &lt;span class="c1"&gt;# Previous command (like ↑)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Ctrl + n &lt;span class="c1"&gt;# Next command (like ↓)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;hr&gt;
&lt;h2 id="-pro-tips"&gt;🧠 Pro Tips&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;sudo !! &lt;span class="c1"&gt;# Rerun last command with sudo&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;!$ &lt;span class="c1"&gt;# Last argument of previous command&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# example:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;mkdir &lt;span class="nb"&gt;test&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; !$ &lt;span class="c1"&gt;# goes into test&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;^old^new &lt;span class="c1"&gt;# Replace text in last command&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# example:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;ls /var/logg
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;^logg^log &lt;span class="c1"&gt;# fixes typo&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;hr&gt;
&lt;h2 id="-clear-history-careful-"&gt;🧼 Clear History (careful 😄)&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;history&lt;/span&gt; -c &lt;span class="c1"&gt;# Clear current session history&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;history&lt;/span&gt; -w &lt;span class="c1"&gt;# Write changes to ~/.bash_history&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;hr&gt;
&lt;h2 id="-bonus-zsh--oh-my-zsh"&gt;🔧 Bonus (zsh / oh-my-zsh)&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Ctrl + r &lt;span class="c1"&gt;# History search&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# Install fzf for an even better search:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# Ctrl + r becomes an interactive fuzzy search&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</description></item><item><title>Bash OTP Generator</title><link>https://tlnd.org/Linux/bash_otp_generator/</link><pubDate>Sun, 05 Jun 2016 00:00:00 +0000</pubDate><guid>https://tlnd.org/Linux/bash_otp_generator/</guid><description>&lt;h1 id="create-an-otp-mfa-tool-in-the-bash-terminal"&gt;Create an OTP MFA Tool in the Bash Terminal&lt;/h1&gt;
&lt;p&gt;I was tired of using &lt;strong&gt;Google Authenticator&lt;/strong&gt;, so I found a simple way to generate my own &lt;strong&gt;OTP (One-Time Password)&lt;/strong&gt; codes directly in &lt;strong&gt;Bash&lt;/strong&gt;.&lt;br&gt;
Just replace the example string below (&lt;code&gt;JHJH...&lt;/code&gt;) with your own secret key.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;/usr/bin/oathtool -b --totp &lt;span class="s1"&gt;&amp;#39;JHJHJHJHJHJHJHJHJHJHJHJHJ&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;If you want to copy the token directly to your clipboard, just use &lt;strong&gt;xclip&lt;/strong&gt;:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;/usr/bin/oathtool -b --totp &lt;span class="s1"&gt;&amp;#39;JHJHJHJHJHJHJHJHJHJHJHJHJ&amp;#39;&lt;/span&gt; &lt;span class="p"&gt;|&lt;/span&gt; xclip -selection c
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This way, you can easily run your own OTP generator right in the terminal.&lt;/p&gt;</description></item><item><title>Extract a Column</title><link>https://tlnd.org/Linux/cli/Filter_from_tab/</link><pubDate>Fri, 03 Jun 2016 00:00:00 +0000</pubDate><guid>https://tlnd.org/Linux/cli/Filter_from_tab/</guid><description>&lt;h1 id="extracting-a-specific-column-in-the-linux-cli"&gt;Extracting a Specific Column in the Linux CLI&lt;/h1&gt;
&lt;p&gt;Sometimes you may need to extract a specific column (or tab-separated field) from a file in the Linux command line.&lt;/p&gt;
&lt;h3 id="example-file"&gt;Example File&lt;/h3&gt;
&lt;p&gt;Let&amp;rsquo;s say we have a file (&lt;code&gt;file.txt&lt;/code&gt;) with the following content:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;A B C 
D E F 
G H I 
&lt;/code&gt;&lt;/pre&gt;&lt;h3 id="extracting-the-first-column"&gt;Extracting the First Column&lt;/h3&gt;
&lt;p&gt;To extract the first column from each line, you can use &lt;code&gt;awk&lt;/code&gt;:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;awk &lt;span class="s1"&gt;&amp;#39;{print $1}&amp;#39;&lt;/span&gt; file.txt
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;strong&gt;Output:&lt;/strong&gt;&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;A 
D 
G 
&lt;/code&gt;&lt;/pre&gt;&lt;h3 id="extracting-the-second-column"&gt;Extracting the Second Column&lt;/h3&gt;
&lt;p&gt;To extract the second column, modify the command:&lt;/p&gt;</description></item><item><title>Diff: compare two files</title><link>https://tlnd.org/Linux/cli/diff/</link><pubDate>Wed, 11 May 2016 00:00:00 +0000</pubDate><guid>https://tlnd.org/Linux/cli/diff/</guid><description>&lt;h1 id="show-the-differences-between-two-files"&gt;Show the differences between two files&lt;/h1&gt;
&lt;p&gt;Side-by-side output, in two columns:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;diff --side-by-side file_one.txt file_two.txt
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Side-by-side output, showing only the lines that differ:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;diff --side-by-side --suppress-common-lines file_one.txt file_two.txt
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;code&gt;-y&lt;/code&gt; is the short form of &lt;code&gt;--side-by-side&lt;/code&gt;.&lt;/p&gt;</description></item><item><title>List outgoing connections</title><link>https://tlnd.org/Linux/cli/outgoing_connections/</link><pubDate>Sat, 02 Apr 2016 00:00:00 +0000</pubDate><guid>https://tlnd.org/Linux/cli/outgoing_connections/</guid><description>&lt;h1 id="how-to-list-outgoing-connections-on-the-linux-cli"&gt;How to list outgoing connections on the Linux CLI&lt;/h1&gt;
&lt;p&gt;A small example of how to show the remote addresses of your connections.&lt;/p&gt;
&lt;p&gt;Outgoing TCP connections:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;netstat -atn &lt;span class="p"&gt;|&lt;/span&gt; tr -s &lt;span class="s1"&gt;&amp;#39; &amp;#39;&lt;/span&gt; &lt;span class="p"&gt;|&lt;/span&gt; cut -f5 -d &lt;span class="s1"&gt;&amp;#39; &amp;#39;&lt;/span&gt; &lt;span class="p"&gt;|&lt;/span&gt; grep -v &lt;span class="s1"&gt;&amp;#39;127.0.0.1&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Outgoing UDP connections:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;netstat -aun &lt;span class="p"&gt;|&lt;/span&gt; tr -s &lt;span class="s1"&gt;&amp;#39; &amp;#39;&lt;/span&gt; &lt;span class="p"&gt;|&lt;/span&gt; cut -f5 -d &lt;span class="s1"&gt;&amp;#39; &amp;#39;&lt;/span&gt; &lt;span class="p"&gt;|&lt;/span&gt; grep -v &lt;span class="s1"&gt;&amp;#39;127.0.0.1&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;On newer systems &lt;code&gt;netstat&lt;/code&gt; may not be installed; &lt;code&gt;ss -tn&lt;/code&gt; (TCP) and &lt;code&gt;ss -un&lt;/code&gt; (UDP) give similar output.&lt;/p&gt;
&lt;h3 id="with-ss-the-modern-way"&gt;With &lt;code&gt;ss&lt;/code&gt; (the modern way)&lt;/h3&gt;
&lt;p&gt;&lt;code&gt;ss&lt;/code&gt; is installed everywhere and can filter by state itself. Only established connections, without the header, with the program that owns them:&lt;/p&gt;</description></item><item><title>Bye Bye Screen, Hello Zellij</title><link>https://tlnd.org/Linux/cli/bye-bye-screen-hello-zellij/</link><pubDate>Mon, 28 Mar 2016 00:00:00 +0000</pubDate><guid>https://tlnd.org/Linux/cli/bye-bye-screen-hello-zellij/</guid><description>&lt;blockquote&gt;
&lt;p&gt;⚠️ &lt;strong&gt;This note is old.&lt;/strong&gt; I don&amp;rsquo;t use Zellij on my desktop any more: I now use the
&lt;a href="https://tlnd.org/Linux/cli/kitty_terminal/"&gt;kitty terminal&lt;/a&gt;, whose tabs, splits and layouts do everything I used
Zellij for. Zellij (or tmux) is still a good choice on a server, when you need sessions
that keep running after you close the terminal or lose your SSH connection.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h1 id="zellij-is-a-great-alternative-to-screen"&gt;&lt;a href="https://zellij.dev/" class="external-link" target="_blank" rel="noopener"&gt;Zellij&lt;/a&gt; is a great alternative to screen!&lt;/h1&gt;
&lt;p&gt;I recently came across Zellij, a really nice replacement for terminal multiplexers like tmux and screen. I instantly became a fan!&lt;/p&gt;</description></item><item><title>Permissions</title><link>https://tlnd.org/Linux/permissions/</link><pubDate>Sat, 12 Mar 2016 00:00:00 +0000</pubDate><guid>https://tlnd.org/Linux/permissions/</guid><description>&lt;h1 id="copy-permissions-and-ownership-from-one-file-to-another"&gt;Copy permissions and ownership from one file to another&lt;/h1&gt;
&lt;h2 id="chmod"&gt;chmod&lt;/h2&gt;
&lt;p&gt;To copy the permissions of one file to another, use &lt;code&gt;chmod&lt;/code&gt; with the &lt;code&gt;--reference&lt;/code&gt; option. Instead of specifying a mode (such as octal permissions like &lt;code&gt;644&lt;/code&gt;), you point to a reference file whose permissions are copied:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;chmod --reference&lt;span class="o"&gt;=&lt;/span&gt;reference_file target_file
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="chown"&gt;chown&lt;/h2&gt;
&lt;p&gt;&lt;code&gt;chown&lt;/code&gt; works the same way for the owner and group:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;chown --reference&lt;span class="o"&gt;=&lt;/span&gt;reference_file target_file
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Add &lt;code&gt;-R&lt;/code&gt; to apply it recursively to a whole directory.&lt;/p&gt;</description></item></channel></rss>