<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Linux on Nerdsid.com</title><link>https://nerdsid.com/tags/linux/</link><description>Recent content in Linux on Nerdsid.com</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Tue, 30 Jun 2026 11:41:54 +0000</lastBuildDate><atom:link href="https://nerdsid.com/tags/linux/index.xml" rel="self" type="application/rss+xml"/><item><title>Practical Grep: Filtering Errors and Patterns in Log Files</title><link>https://nerdsid.com/posts/practical-grep-filtering-errors-and-patterns-in-log-files/</link><pubDate>Tue, 30 Jun 2026 11:41:54 +0000</pubDate><guid>https://nerdsid.com/posts/practical-grep-filtering-errors-and-patterns-in-log-files/</guid><description>&lt;h2 id="introduction">Introduction&lt;/h2>
&lt;p>This walkthrough covers using grep to search and filter log files for errors, specific requests, and multi-pattern matches.&lt;/p>
&lt;h2 id="tasks">Tasks&lt;/h2>
&lt;ol>
&lt;li>Find all &lt;code>ERROR&lt;/code> messages in &lt;code>system.log&lt;/code> and count how many there are.&lt;/li>
&lt;li>Find all lines containing &lt;code>POST&lt;/code> requests in &lt;code>access.log&lt;/code>.&lt;/li>
&lt;li>Find all lines in &lt;code>application.log&lt;/code> that contain both &lt;code>WARNING&lt;/code> and &lt;code>query&lt;/code> (case-insensitive).&lt;/li>
&lt;li>Search for all user authentications (containing &lt;code>User authenticated&lt;/code>) across all log files.&lt;/li>
&lt;/ol>
&lt;h3 id="requirements">Requirements&lt;/h3>
&lt;ul>
&lt;li>Use &lt;code>grep&lt;/code> for all searches (combining with other commands like &lt;code>wc&lt;/code> where needed).&lt;/li>
&lt;li>Save each task&amp;rsquo;s output to its own file: &lt;code>task1_output.txt&lt;/code>, &lt;code>task2_output.txt&lt;/code>, &lt;code>task3_output.txt&lt;/code>, &lt;code>task4_output.txt&lt;/code>.&lt;/li>
&lt;li>Original log files must not be modified.&lt;/li>
&lt;/ul>
&lt;h2 id="solution">Solution&lt;/h2>
&lt;h3 id="task-1">Task 1&lt;/h3>






&lt;div class="codeblock">
 &lt;div class="codeblock__header">
 &lt;div class="codeblock__filename codeblock__filename--lang">
 
 BASH
 
 &lt;/div>
 &lt;div class="codeblock__actions">
 
 &lt;/div>
 &lt;/div>
 &lt;div class="codeblock__body">
 &lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-bash" data-lang="bash">&lt;span class="line">&lt;span class="cl">grep -c &lt;span class="s2">&amp;#34;ERROR&amp;#34;&lt;/span> system.log &amp;gt; task1_output.txt&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>
 &lt;/div>
&lt;/div>&lt;p>&lt;code>grep -c&lt;/code> counts the number of matching lines instead of printing them. Redirecting the output saves the count to task1_output.txt.&lt;/p></description></item><item><title>Linux Journalctl Command Cheat Sheet</title><link>https://nerdsid.com/posts/linux-journalctl-cheatsheet/</link><pubDate>Wed, 15 Apr 2026 06:39:17 +0000</pubDate><guid>https://nerdsid.com/posts/linux-journalctl-cheatsheet/</guid><description>&lt;p>I recently needed to free up disk space by removing old system logs, so I collected the command I used and other useful journalctl commands for future reference.&lt;/p>
&lt;h2 id="disk-usage--vacuum-remove-old-logs">Disk usage &amp;amp; vacuum (remove old logs)&lt;/h2>
&lt;p>Show journal disk usage:&lt;/p>






&lt;div class="codeblock">
 &lt;div class="codeblock__header">
 &lt;div class="codeblock__filename codeblock__filename--lang">
 
 BASH
 
 &lt;/div>
 &lt;div class="codeblock__actions">
 
 &lt;/div>
 &lt;/div>
 &lt;div class="codeblock__body">
 &lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-bash" data-lang="bash">&lt;span class="line">&lt;span class="cl">sudo journalctl --disk-usage&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>
 &lt;/div>
&lt;/div>&lt;p>Remove archived journal files until total size is below X:&lt;/p>






&lt;div class="codeblock">
 &lt;div class="codeblock__header">
 &lt;div class="codeblock__filename codeblock__filename--lang">
 
 BASH
 
 &lt;/div>
 &lt;div class="codeblock__actions">
 
 &lt;/div>
 &lt;/div>
 &lt;div class="codeblock__body">
 &lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-bash" data-lang="bash">&lt;span class="line">&lt;span class="cl">sudo journalctl --vacuum-size&lt;span class="o">=&lt;/span>500M&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>
 &lt;/div>
&lt;/div>&lt;p>Remove archived journal files older than a time:&lt;/p>






&lt;div class="codeblock">
 &lt;div class="codeblock__header">
 &lt;div class="codeblock__filename codeblock__filename--lang">
 
 BASH
 
 &lt;/div>
 &lt;div class="codeblock__actions">
 
 &lt;/div>
 &lt;/div>
 &lt;div class="codeblock__body">
 &lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-bash" data-lang="bash">&lt;span class="line">&lt;span class="cl">sudo journalctl --vacuum-time&lt;span class="o">=&lt;/span>3d&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>
 &lt;/div>
&lt;/div>&lt;p>Remove archived journal files, keeping only the most recent N files:&lt;/p></description></item><item><title>Ultimate Vi Shortcuts Cheat Sheet</title><link>https://nerdsid.com/posts/vi-shortcuts-cheatsheet/</link><pubDate>Tue, 07 Apr 2026 20:43:00 +0000</pubDate><guid>https://nerdsid.com/posts/vi-shortcuts-cheatsheet/</guid><description>&lt;h2 id="big-picture-of-vim-commands">Big picture of Vim commands&lt;/h2>
&lt;ol>
&lt;li>Normal mode (default)&lt;/li>
&lt;/ol>






&lt;div class="codeblock">
 &lt;div class="codeblock__header">
 &lt;div class="codeblock__filename codeblock__filename--lang">
 
 &lt;/div>
 &lt;div class="codeblock__actions">
 
 &lt;/div>
 &lt;/div>
 &lt;div class="codeblock__body">
 &lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-text" data-lang="text">&lt;span class="line">&lt;span class="cl"> ├── Navigation (h, j, k, l, G)
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> ├── Editing (d, c, x)
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> ├── Insert triggers (i, a, o, O, A)&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>
 &lt;/div>
&lt;/div>&lt;ol start="2">
&lt;li>
&lt;p>Insert mode
→ typing text&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Visual mode
→ selecting text&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Command mode (:)
→ commands like :w, :q, :10,20d&lt;/p>
&lt;/li>
&lt;/ol>
&lt;h2 id="navigation-movement-commands">Navigation (movement commands)&lt;/h2>






&lt;div class="codeblock">
 &lt;div class="codeblock__header">
 &lt;div class="codeblock__filename codeblock__filename--lang">
 
 TEXT
 
 &lt;/div>
 &lt;div class="codeblock__actions">
 
 &lt;/div>
 &lt;/div>
 &lt;div class="codeblock__body">
 &lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-text" data-lang="text">&lt;span class="line">&lt;span class="cl">G&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>
 &lt;/div>
&lt;/div>&lt;ul>
&lt;li>&lt;code>G&lt;/code> → go to last line&lt;/li>
&lt;/ul>
&lt;h2 id="2-editing--insertion-commands">2. Editing / insertion commands&lt;/h2>
&lt;p>&lt;code>o&lt;/code>, &lt;code>O&lt;/code>, &lt;code>A&lt;/code> : These change the file and switch you to insert mode.&lt;/p></description></item><item><title>How to Fix the Apostrophe (') Key Not Working in VirtualBox Ubuntu</title><link>https://nerdsid.com/posts/virtualbox-apostrophe-key-not-working/</link><pubDate>Tue, 07 Apr 2026 07:32:28 +0530</pubDate><guid>https://nerdsid.com/posts/virtualbox-apostrophe-key-not-working/</guid><description>&lt;p>If you’re running Ubuntu inside Oracle VM VirtualBox and notice that pressing the apostrophe (&amp;rsquo;) or tildae (`) key doesn’t show anything until you hit space, you’re not alone.&lt;/p>
&lt;p>This issue is caused by “dead keys” in keyboard layouts, where keys are designed to combine with others to create accented characters.&lt;/p>
&lt;p>In this guide, I’ll show you two simple fixes to make your apostrophe key work.&lt;/p>
&lt;h2 id="root-cause">Root cause&lt;/h2>
&lt;p>What you’re seeing is a keyboard layout / “dead key” behavior, not a VirtualBox bug.&lt;/p></description></item><item><title>Linux Commands Cheat Sheet (Most Used Commands)</title><link>https://nerdsid.com/posts/linux-commands-cheatsheet/</link><pubDate>Fri, 03 Apr 2026 07:32:28 +0530</pubDate><guid>https://nerdsid.com/posts/linux-commands-cheatsheet/</guid><description>&lt;h2 id="table-of-contents">Table of Contents&lt;/h2>
&lt;ul>
&lt;li>Disk Usage / File Analysis&lt;/li>
&lt;li>AWS S3 commands&lt;/li>
&lt;/ul>
&lt;h2 id="disk-usage--file-analysis">Disk Usage / File Analysis&lt;/h2>
&lt;h3 id="find-out-space-taken-by-files-older-than-5-days">Find out space taken by files older than 5 days&lt;/h3>






&lt;div class="codeblock">
 &lt;div class="codeblock__header">
 &lt;div class="codeblock__filename codeblock__filename--lang">
 
 BASH
 
 &lt;/div>
 &lt;div class="codeblock__actions">
 
 &lt;/div>
 &lt;/div>
 &lt;div class="codeblock__body">
 &lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-bash" data-lang="bash">&lt;span class="line">&lt;span class="cl">find . -type f -mtime +5 -print0 &lt;span class="p">|&lt;/span> du --files0-from&lt;span class="o">=&lt;/span>- -ch &lt;span class="p">|&lt;/span> grep total&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>
 &lt;/div>
&lt;/div>&lt;h3 id="keep-last-100d-fies">Keep last 100d fies&lt;/h3>






&lt;div class="codeblock">
 &lt;div class="codeblock__header">
 &lt;div class="codeblock__filename codeblock__filename--lang">
 
 BASH
 
 &lt;/div>
 &lt;div class="codeblock__actions">
 
 &lt;/div>
 &lt;/div>
 &lt;div class="codeblock__body">
 &lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-bash" data-lang="bash">&lt;span class="line">&lt;span class="cl">ls -t &lt;span class="p">|&lt;/span> sed -e &lt;span class="s1">&amp;#39;1,100d&amp;#39;&lt;/span> &lt;span class="p">|&lt;/span> xargs -d &lt;span class="s1">&amp;#39;\n&amp;#39;&lt;/span> rm -f --&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>
 &lt;/div>
&lt;/div>





&lt;div class="codeblock">
 &lt;div class="codeblock__header">
 &lt;div class="codeblock__filename codeblock__filename--lang">
 
 BASH
 
 &lt;/div>
 &lt;div class="codeblock__actions">
 
 &lt;/div>
 &lt;/div>
 &lt;div class="codeblock__body">
 &lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-bash" data-lang="bash">&lt;span class="line">&lt;span class="cl">truncate -s 50M catalina.out&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>
 &lt;/div>
&lt;/div>





&lt;div class="codeblock">
 &lt;div class="codeblock__header">
 &lt;div class="codeblock__filename codeblock__filename--lang">
 
 BASH
 
 &lt;/div>
 &lt;div class="codeblock__actions">
 
 &lt;/div>
 &lt;/div>
 &lt;div class="codeblock__body">
 &lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-bash" data-lang="bash">&lt;span class="line">&lt;span class="cl">ls -d */&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>
 &lt;/div>
&lt;/div>&lt;h3 id="find-out-year-month-of-files">Find out Year month of files&lt;/h3>






&lt;div class="codeblock">
 &lt;div class="codeblock__header">
 &lt;div class="codeblock__filename codeblock__filename--lang">
 
 BASH
 
 &lt;/div>
 &lt;div class="codeblock__actions">
 
 &lt;/div>
 &lt;/div>
 &lt;div class="codeblock__body">
 &lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-bash" data-lang="bash">&lt;span class="line">&lt;span class="cl">stat -c &lt;span class="s1">&amp;#39;%y&amp;#39;&lt;/span> * &lt;span class="p">|&lt;/span> awk &lt;span class="s1">&amp;#39;{print $1}&amp;#39;&lt;/span> &lt;span class="p">|&lt;/span> xargs -I&lt;span class="o">{}&lt;/span> date -d &lt;span class="o">{}&lt;/span> &lt;span class="s2">&amp;#34;+%b %Y&amp;#34;&lt;/span> &lt;span class="p">|&lt;/span> sort -u&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>
 &lt;/div>
&lt;/div>&lt;h3 id="list-all-files-other-than-gz">List all files other than &lt;code>.gz&lt;/code>&lt;/h3>
&lt;p>If you want this to do recursively:&lt;/p></description></item><item><title>Grep Failing on Hyphen Patterns? Try This Fix</title><link>https://nerdsid.com/posts/grep-failing-on-hyphen-patterns-try-this-fix/</link><pubDate>Fri, 05 Dec 2025 18:48:38 +0530</pubDate><guid>https://nerdsid.com/posts/grep-failing-on-hyphen-patterns-try-this-fix/</guid><description>&lt;p>Today I was searching for &lt;code>--debug&lt;/code> in a log file.&lt;/p>
&lt;p>So, I ran &lt;code>grep &amp;quot;--debug&amp;quot; file.log&lt;/code>.&lt;/p>
&lt;p>To my utter surprise, instead of seeing a match, I got this error:&lt;/p>

&lt;figure class="terminal no-copy">
 &lt;header class="terminal-header">
 &lt;div class="terminal-controls">
 &lt;span class="dot dot--red">&lt;/span>
 &lt;span class="dot dot--yellow">&lt;/span>
 &lt;span class="dot dot--green">&lt;/span>
 &lt;/div>
 
 &lt;figcaption class="terminal-title">grep output&lt;/figcaption>
 
 &lt;/header>
 &lt;pre>&lt;code>
grep: unrecognized option '--debug'
Usage: grep [OPTION]... PATTERNS [FILE]...&lt;/code>&lt;/pre>
&lt;/figure>

&lt;p>I didn&amp;rsquo;t expect to see any error because I had quoted the pattern (&lt;code>&amp;quot;--debug&amp;quot;&lt;/code>).&lt;/p>
&lt;p>After few minutes of searching, I found the fix:&lt;/p>






&lt;div class="codeblock">
 &lt;div class="codeblock__header">
 &lt;div class="codeblock__filename codeblock__filename--lang">
 
 &lt;/div>
 &lt;div class="codeblock__actions">
 
 &lt;/div>
 &lt;/div>
 &lt;div class="codeblock__body">
 &lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-text" data-lang="text">&lt;span class="line">&lt;span class="cl">grep -- --debug file.log&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>
 &lt;/div>
&lt;/div>&lt;p>This is where the humble double hyphen &lt;code>--&lt;/code> steps in.&lt;/p></description></item><item><title>11 Essential OpenSSH Components</title><link>https://nerdsid.com/posts/11-essential-openssh-components/</link><pubDate>Sat, 29 Nov 2025 20:05:20 +0530</pubDate><guid>https://nerdsid.com/posts/11-essential-openssh-components/</guid><description>&lt;p>You might have SSHed into servers hundreds of times.&lt;/p>
&lt;p>You might have used &lt;code>ssh-add&lt;/code> to load keys into your agent.&lt;/p>
&lt;p>You might have used &lt;code>scp&lt;/code> to copy files back and forth between your machine and server.&lt;/p>
&lt;p>But have you ever paused and looked at the bigger picture?&lt;/p>
&lt;p>All these commands come from one place — the OpenSSH suite. It’s much more than just &lt;code>ssh&lt;/code> and &lt;code>scp&lt;/code>.&lt;/p>
&lt;img
 class="spotlight"
 src="https://nerdsid.com/images/11-essential-open-ssh-components/OpenSSH-components.svg"
 alt="OpenSSH components breakdown"
 loading="lazy"
 >
&lt;h1 id="openssh-components">OpenSSH components&lt;/h1>
&lt;p>OpenSSH has &lt;strong>11 major&lt;/strong> components.&lt;/p></description></item><item><title>10 Steps to Secure a New Linux VM</title><link>https://nerdsid.com/posts/10-steps-to-make-a-new-linux-vm-safe/</link><pubDate>Wed, 22 Oct 2025 07:09:42 +0000</pubDate><guid>https://nerdsid.com/posts/10-steps-to-make-a-new-linux-vm-safe/</guid><description>&lt;p>When you launch a new Linux VM, the level of security you really need depends on your use case. That said, there are some basic steps you can take right after provisioning a new VM, to improve it&amp;rsquo;s baseline security. Following these steps won’t make your server invincible, but it will make it safe and reduce exposure to common attacks.&lt;/p>
&lt;h2 id="1-update-your-system">1. Update your system&lt;/h2>
&lt;p>Newly deployed images can contain outdated packages with known vulnerabilities. Start by updating everything:&lt;/p></description></item><item><title>4 Ways to Watch Logs Live in Linux</title><link>https://nerdsid.com/posts/watch-logs-live-in-linux/</link><pubDate>Wed, 15 Oct 2025 12:49:55 +0530</pubDate><guid>https://nerdsid.com/posts/watch-logs-live-in-linux/</guid><description>&lt;h2 id="1-tail--f">1. &lt;code>tail -f&lt;/code>&lt;/h2>
&lt;p>&lt;strong>Use when:&lt;/strong>&lt;/p>
&lt;ul>
&lt;li>You want to quickly stream a log file.&lt;/li>
&lt;li>You want to perform short, one-off checks on a single log file.&lt;/li>
&lt;/ul>
&lt;!-- - Great for one-off checks, ad-hoc debugging (like checking `nginx/access.log` or `app.log`). -->
&lt;p>&lt;strong>Availibility&lt;/strong>: available on all Linux/Unix systems.&lt;/p>
&lt;p>&lt;strong>Example:&lt;/strong>&lt;/p>






&lt;div class="codeblock">
 &lt;div class="codeblock__header">
 &lt;div class="codeblock__filename codeblock__filename--lang">
 
 BASH
 
 &lt;/div>
 &lt;div class="codeblock__actions">
 
 &lt;/div>
 &lt;/div>
 &lt;div class="codeblock__body">
 &lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-bash" data-lang="bash">&lt;span class="line">&lt;span class="cl">tail -f /var/log/syslog&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>
 &lt;/div>
&lt;/div>&lt;h2 id="2-tail--f">2. &lt;code>tail -F&lt;/code>&lt;/h2>
&lt;p>Some services (like Nginx, Apache) &lt;strong>rotate logs&lt;/strong> i.e. they stop writing logs to an old file and instead write to a new file (named sequentially).
&lt;code>tail -f&lt;/code> stops following when that happens, but &lt;code>tail -F&lt;/code> automatically switches to the new file. In other words, it handles log rotation gracefully.&lt;/p></description></item><item><title>Differnece Between X Window System and a Desktop Environment</title><link>https://nerdsid.com/posts/x-window-system-vs-desktop-environment/</link><pubDate>Tue, 14 Jan 2025 11:31:46 +0000</pubDate><guid>https://nerdsid.com/posts/x-window-system-vs-desktop-environment/</guid><description>&lt;p>The &lt;strong>X Window System&lt;/strong> and a &lt;strong>desktop environment&lt;/strong> are related but serve different purposes in a graphical user interface (GUI) on Linux.&lt;/p>
&lt;ul>
&lt;li>
&lt;p>&lt;strong>X Window System (X11)&lt;/strong>: It is the foundational framework that provides the basic functionality for displaying graphical applications. X manages windows, handles input devices (like the mouse and keyboard), and allows graphical applications to display their content. However, X alone does not provide a full, user-friendly interface; it merely acts as the underlying protocol for graphical communication.&lt;/p></description></item><item><title>Understanding Bootloader With a Toy Robot Example</title><link>https://nerdsid.com/posts/understanding-bootloader-with-a-toy-robot-example/</link><pubDate>Tue, 14 Jan 2025 10:47:04 +0000</pubDate><guid>https://nerdsid.com/posts/understanding-bootloader-with-a-toy-robot-example/</guid><description>&lt;p>Imagine you have a toy robot that needs to be turned on before it can start moving and talking. When you press the power button, the robot goes through a quick check to make sure its batteries are working, its wheels can spin, and its voice box is ready. It makes sure all components are connected and are in a working state.&lt;/p>
&lt;p>This initial check is like a bootloader. The bootloader performs similar checks on your computer or device. It ensures the system’s hardware (like memory, storage, and CPU) is functioning correctly before anything else happens.&lt;/p></description></item><item><title>Understanding the Kernel and Distribution With a Restaurant Example</title><link>https://nerdsid.com/posts/kernel-vs-distribution-a-restaurant-example/</link><pubDate>Tue, 14 Jan 2025 09:28:28 +0000</pubDate><guid>https://nerdsid.com/posts/kernel-vs-distribution-a-restaurant-example/</guid><description>&lt;p>Let’s use the example of a restaurant to illustrate the concepts of a &lt;strong>kernel&lt;/strong> and a &lt;strong>distribution&lt;/strong>.&lt;/p>
&lt;h2 id="kernel-the-chef">Kernel: The Chef&lt;/h2>
&lt;p>Think of the kernel as the &lt;strong>head chef&lt;/strong> in a restaurant. The chef is responsible for managing the kitchen, ensuring that all the ingredients are prepared correctly, and that the cooking processes are followed. The chef makes sure that everything runs smoothly in the kitchen, coordinating the cooking of different dishes and managing the kitchen staff. Without the chef, the kitchen would be chaotic, and the food wouldn’t be prepared properly.&lt;/p></description></item><item><title>Key Linux Terms Explained: Kernel, Bootloader, Filesystem &amp; More</title><link>https://nerdsid.com/posts/key-linux-terms-explained-kernel-bootloader-file-system-more/</link><pubDate>Tue, 14 Jan 2025 08:26:23 +0000</pubDate><guid>https://nerdsid.com/posts/key-linux-terms-explained-kernel-bootloader-file-system-more/</guid><description>&lt;p>Before you begin to use Linux, you need to be aware of certain terms like: Kernel, Bootlader, Window system, service etc.&lt;/p>
&lt;h2 id="kernel">Kernel&lt;/h2>
&lt;p>Kernel is the glue between hardware and applications. It controls hardware and allows applications to make use of the hardware.&lt;/p>
&lt;p>Examples: Linux kernel&lt;/p>
&lt;h2 id="distribution">Distribution&lt;/h2>
&lt;p>A Linux distribution (or distro) is essentially the same as an operating system (OS) in the context of Linux.&lt;/p>
&lt;p>Linux distro includes not only the Linux kernel (the core part of the OS) but also additional software, tools, libraries, and user interfaces that together form a complete, functional system.&lt;/p></description></item><item><title>Shortcuts to Navigate in a Terminal</title><link>https://nerdsid.com/posts/shortcuts-to-navigate-in-a-terminal/</link><pubDate>Wed, 13 Sep 2023 16:51:56 +0530</pubDate><guid>https://nerdsid.com/posts/shortcuts-to-navigate-in-a-terminal/</guid><description>&lt;p>Like in any other text based program, linux terminals also support usage of arrow keys, backspace to navigate and edit text. But there are some shortcuts which can replace multiple use of arrow keys and simplify user experience. Following table lists some shortcuts.&lt;/p>
&lt;table>
 &lt;thead>
 &lt;tr>
 &lt;th>Shortcut&lt;/th>
 &lt;th>Action&lt;/th>
 &lt;/tr>
 &lt;/thead>
 &lt;tbody>
 &lt;tr>
 &lt;td>Ctrl+A&lt;/td>
 &lt;td>Jump to the beginning of the command line.&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td>Ctrl+E&lt;/td>
 &lt;td>Jump to the end of the command line.&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td>Ctrl+U&lt;/td>
 &lt;td>Clear from the cursor to the beginning of the command line.&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td>Ctrl+K&lt;/td>
 &lt;td>Clear from the cursor to the end of the command line.&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td>Ctrl+LeftArrow&lt;/td>
 &lt;td>Jump to the beginning of the previous word on the command line.&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td>Ctrl+RightArrow&lt;/td>
 &lt;td>Jump to the end of the next word on the command line.&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td>Ctrl+R&lt;/td>
 &lt;td>Search the history list of commands for a pattern.&lt;/td>
 &lt;/tr>
 &lt;/tbody>
&lt;/table>
&lt;p>More such shortcuts can be found in the bash man page.&lt;/p></description></item><item><title>One Line Command to Create an SSH Key</title><link>https://nerdsid.com/posts/one-line-command-to-create-ssh-key/</link><pubDate>Thu, 30 Mar 2023 00:00:00 -0800</pubDate><guid>https://nerdsid.com/posts/one-line-command-to-create-ssh-key/</guid><description>&lt;p>Of late, I have been creating a lot of SSH keys. I am tired of answering each question that one gets asked during such a process. So, I thought of looking up all the switches (options) for the &lt;code>ssh-keygen&lt;/code> command so that I can specify everything at once.&lt;/p>
&lt;p>Here is the command:&lt;/p>
&lt;p>For bash:&lt;/p>






&lt;div class="codeblock">
 &lt;div class="codeblock__header">
 &lt;div class="codeblock__filename codeblock__filename--lang">
 
 POWERSHELL
 
 &lt;/div>
 &lt;div class="codeblock__actions">
 
 &lt;/div>
 &lt;/div>
 &lt;div class="codeblock__body">
 &lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-powershell" data-lang="powershell">&lt;span class="line">&lt;span class="cl">&lt;span class="nb">ssh-keygen&lt;/span> &lt;span class="n">-t&lt;/span> &lt;span class="n">ed25519&lt;/span> &lt;span class="n">-b&lt;/span> &lt;span class="mf">4096&lt;/span> &lt;span class="n">-C&lt;/span> &lt;span class="s2">&amp;#34;you@mail.com for Gitlab&amp;#34;&lt;/span> &lt;span class="n">-N&lt;/span> &lt;span class="s2">&amp;#34;&amp;#34;&lt;/span> &lt;span class="o">-f&lt;/span> &lt;span class="s2">&amp;#34;/home/usr/.ssh/key&amp;#34;&lt;/span> &lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>
 &lt;/div>
&lt;/div>&lt;p>For powershell:&lt;/p>






&lt;div class="codeblock">
 &lt;div class="codeblock__header">
 &lt;div class="codeblock__filename codeblock__filename--lang">
 
 POWERSHELL
 
 &lt;/div>
 &lt;div class="codeblock__actions">
 
 &lt;/div>
 &lt;/div>
 &lt;div class="codeblock__body">
 &lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-powershell" data-lang="powershell">&lt;span class="line">&lt;span class="cl">&lt;span class="nb">ssh-keygen&lt;/span> &lt;span class="n">-t&lt;/span> &lt;span class="n">ed25519&lt;/span> &lt;span class="n">-b&lt;/span> &lt;span class="mf">4096&lt;/span> &lt;span class="n">-C&lt;/span> &lt;span class="s2">&amp;#34;you@mail.com for Gitlab&amp;#34;&lt;/span> &lt;span class="n">-N&lt;/span> &lt;span class="s1">&amp;#39;&amp;#34;&amp;#34;&amp;#39;&lt;/span> &lt;span class="o">-f&lt;/span> &lt;span class="s2">&amp;#34;C:\Users\uname\.ssh\keyname&amp;#34;&lt;/span> &lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>
 &lt;/div>
&lt;/div>&lt;h2 id="description">Description&lt;/h2>
&lt;p>The above command generates an SSH key pair using the &lt;code>ed25519&lt;/code> algorithm with a 4096-bit key length, and saves the private and public keys with the specified name (and location).&lt;/p></description></item><item><title>How to Fix SSH Error: Could not open a connection to your authentication agent</title><link>https://nerdsid.com/posts/fix-ssh-could-not-open-connection-to-auth-agent/</link><pubDate>Sat, 07 Jan 2023 07:32:28 +0530</pubDate><guid>https://nerdsid.com/posts/fix-ssh-could-not-open-connection-to-auth-agent/</guid><description>&lt;h2 id="the-problem">The problem&lt;/h2>
&lt;p>Recently, I was trying to add a SSH key to the &lt;code>ssh-agent&lt;/code>. So, I ran the following command:&lt;/p>






&lt;div class="codeblock">
 &lt;div class="codeblock__header">
 &lt;div class="codeblock__filename codeblock__filename--lang">
 
 BASH
 
 &lt;/div>
 &lt;div class="codeblock__actions">
 
 &lt;/div>
 &lt;/div>
 &lt;div class="codeblock__body">
 &lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-bash" data-lang="bash">&lt;span class="line">&lt;span class="cl">ssh-add ~/.ssh/&amp;lt;key_name&amp;gt;&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>
 &lt;/div>
&lt;/div>&lt;p>This resulted in the following error:&lt;/p>






&lt;div class="codeblock">
 &lt;div class="codeblock__header">
 &lt;div class="codeblock__filename codeblock__filename--lang">
 
 BASH
 
 &lt;/div>
 &lt;div class="codeblock__actions">
 
 &lt;/div>
 &lt;/div>
 &lt;div class="codeblock__body">
 &lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-bash" data-lang="bash">&lt;span class="line">&lt;span class="cl">Could not open a connection to your authentication agent.&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>
 &lt;/div>
&lt;/div>&lt;h2 id="the-solution">The solution&lt;/h2>
&lt;p>The error message is pretty clear. Since a connection to the &lt;code>ssh-agent&lt;/code> could not be opened, first let&amp;rsquo;s check if the &lt;code>ssh-agent&lt;/code> is running or not.&lt;/p>






&lt;div class="codeblock">
 &lt;div class="codeblock__header">
 &lt;div class="codeblock__filename codeblock__filename--lang">
 
 BASH
 
 &lt;/div>
 &lt;div class="codeblock__actions">
 
 &lt;/div>
 &lt;/div>
 &lt;div class="codeblock__body">
 &lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-bash" data-lang="bash">&lt;span class="line">&lt;span class="cl">ps -e &lt;span class="p">|&lt;/span> grep &lt;span class="o">[&lt;/span>s&lt;span class="o">]&lt;/span>sh-agent&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>
 &lt;/div>
&lt;/div>&lt;p>If the &lt;code>ssh-agent&lt;/code> is not running, you will not see any output. This is exactly what happened in my case. So, the solution is simple: you need to start the &lt;code>ssh-agent&lt;/code>.&lt;/p></description></item><item><title>Equivalent of Linux Commands in Powershell</title><link>https://nerdsid.com/posts/equivalent-of-linux-commands-in-powershell/</link><pubDate>Wed, 26 Oct 2022 17:54:30 +0530</pubDate><guid>https://nerdsid.com/posts/equivalent-of-linux-commands-in-powershell/</guid><description>&lt;p>Being an avid linux user, I am used to the linux commands. But I often work on a windows machine, which is when I look for powershell equivalent of linux commands.&lt;/p>
&lt;p>I created this post to keep a track of the commands that I use often.&lt;/p>
&lt;h2 id="well-known-linux-commands-and-their-powershell-equivalents">Well-known linux commands and their powershell equivalents&lt;/h2>
&lt;p>The PowerShell commands for working with the file system are same as that of linux ones. You navigate around the file system with the &lt;code>cd&lt;/code> (alias for &lt;code>Set-Location&lt;/code>) command.&lt;/p></description></item></channel></rss>