<?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 Sandra Ashipala</title><link>https://sandramsc-fun.sandraashipala.workers.dev/tags/cli/</link><description>Recent content in CLI on Sandra Ashipala</description><generator>Hugo -- gohugo.io</generator><language>en</language><lastBuildDate>Fri, 29 Dec 2023 00:00:00 +0000</lastBuildDate><atom:link href="https://sandramsc-fun.sandraashipala.workers.dev/tags/cli/index.xml" rel="self" type="application/rss+xml"/><item><title>Installing WSL on Windows 11 Home (Ubuntu)</title><link>https://sandramsc-fun.sandraashipala.workers.dev/post/installing-wsl-on-windows/</link><pubDate>Fri, 29 Dec 2023 00:00:00 +0000</pubDate><guid>https://sandramsc-fun.sandraashipala.workers.dev/post/installing-wsl-on-windows/</guid><description>&lt;img src="https://sandramsc-fun.sandraashipala.workers.dev/post/installing-wsl-on-windows/featured.jpg" alt="Featured image of post Installing WSL on Windows 11 Home (Ubuntu)" />&lt;p>Windows Subsystem for Linux (WSL) offers a powerful way to integrate Windows 11 Home with Linux. Having a growing interest in Linux and venturing into DevOps, I decided to find out how Ubuntu can be used on my new Windows machine—after previously trying to install Ubuntu on a bootable USB and realizing I mostly used the CLI rather than the bundled desktop apps.&lt;/p>
&lt;p>This article details how to install WSL with Ubuntu on Windows 11 Home, providing a practical approach to enhancing your development workflow.&lt;/p>
&lt;h2 id="why-wsl">Why WSL?
&lt;/h2>&lt;p>With WSL, you get direct access to Linux command-line tools without giving up Windows convenience or dual-booting.&lt;/p>
&lt;hr>
&lt;h2 id="installation-steps">Installation Steps
&lt;/h2>&lt;h3 id="step-1-enable-windows-subsystem-for-linux">Step 1: Enable Windows Subsystem for Linux
&lt;/h3>&lt;ol>
&lt;li>Click on the &lt;strong>Start&lt;/strong> menu.&lt;/li>
&lt;li>Search for &lt;strong>Turn Windows features on or off&lt;/strong> and open it.&lt;/li>
&lt;li>Scroll to the bottom and check the box for &lt;strong>Windows Subsystem for Linux&lt;/strong>.
&lt;img src="https://sandramsc-fun.sandraashipala.workers.dev/post/installing-wsl-on-windows/image_0.png"
width="555"
height="491"
srcset="https://sandramsc-fun.sandraashipala.workers.dev/post/installing-wsl-on-windows/image_0_hu_41566678db8f67c4.png 480w, https://sandramsc-fun.sandraashipala.workers.dev/post/installing-wsl-on-windows/image_0_hu_a4822bbf7ae4ee59.png 1024w"
loading="lazy"
alt="Windows Features dialog with Windows Subsystem for Linux checked"
class="gallery-image"
data-flex-grow="113"
data-flex-basis="271px"
>&lt;/li>
&lt;li>Click &lt;strong>OK&lt;/strong>.&lt;/li>
&lt;li>Click &lt;strong>Restart now&lt;/strong> so the changes take effect.
&lt;img src="https://sandramsc-fun.sandraashipala.workers.dev/post/installing-wsl-on-windows/image_1.png"
width="757"
height="628"
srcset="https://sandramsc-fun.sandraashipala.workers.dev/post/installing-wsl-on-windows/image_1_hu_8b817127d706e41c.png 480w, https://sandramsc-fun.sandraashipala.workers.dev/post/installing-wsl-on-windows/image_1_hu_2a652ad088be4626.png 1024w"
loading="lazy"
alt="Windows Features confirmation or restart prompt"
class="gallery-image"
data-flex-grow="120"
data-flex-basis="289px"
>&lt;/li>
&lt;/ol>
&lt;hr>
&lt;h3 id="step-2-install-wsl2">Step 2: Install WSL2
&lt;/h3>&lt;ol>
&lt;li>Launch &lt;strong>PowerShell&lt;/strong> as Administrator.&lt;/li>
&lt;li>To view available distributions verified for installation, run:&lt;/li>
&lt;/ol>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&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="n">wsl&lt;/span> &lt;span class="p">-&lt;/span>&lt;span class="n">-list&lt;/span> &lt;span class="p">-&lt;/span>&lt;span class="n">-online&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;ol start="3">
&lt;li>To install the default Ubuntu distribution, run:&lt;/li>
&lt;/ol>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&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="n">wsl&lt;/span> &lt;span class="p">-&lt;/span>&lt;span class="n">-install&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;p>&lt;img src="https://sandramsc-fun.sandraashipala.workers.dev/post/installing-wsl-on-windows/image_2.png"
width="1100"
height="195"
srcset="https://sandramsc-fun.sandraashipala.workers.dev/post/installing-wsl-on-windows/image_2_hu_7831d912bea547ff.png 480w, https://sandramsc-fun.sandraashipala.workers.dev/post/installing-wsl-on-windows/image_2_hu_a969338795cf2ca2.png 1024w"
loading="lazy"
alt="Windows Features confirmation or restart prompt"
class="gallery-image"
data-flex-grow="564"
data-flex-basis="1353px"
>&lt;/p>
&lt;ol start="4">
&lt;li>To install a specific distribution, run:&lt;/li>
&lt;/ol>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&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="n">wsl&lt;/span> &lt;span class="p">-&lt;/span>&lt;span class="n">-install&lt;/span> &lt;span class="n">-d&lt;/span> &lt;span class="nb">DISTRO-NAME&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;p>For example, running:&lt;/p>
&lt;div class="highlight">&lt;div class="chroma">
&lt;table class="lntable">&lt;tr>&lt;td class="lntd">
&lt;pre tabindex="0" class="chroma">&lt;code>&lt;span class="lnt">1
&lt;/span>&lt;/code>&lt;/pre>&lt;/td>
&lt;td class="lntd">
&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="n">wsl&lt;/span> &lt;span class="p">-&lt;/span>&lt;span class="n">-install&lt;/span> &lt;span class="n">-d&lt;/span> &lt;span class="n">Ubuntu&lt;/span>&lt;span class="p">-&lt;/span>&lt;span class="mf">20.04&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/td>&lt;/tr>&lt;/table>
&lt;/div>
&lt;/div>&lt;p>will install Ubuntu 20.04 LTS.&lt;/p>
&lt;ol start="5">
&lt;li>Restart your machine when prompted.&lt;/li>
&lt;/ol>
&lt;hr>
&lt;h3 id="step-3-set-up-ubuntu">Step 3: Set Up Ubuntu
&lt;/h3>&lt;ol>
&lt;li>Launch the installed &lt;strong>Ubuntu&lt;/strong> app from the &lt;strong>Start&lt;/strong> menu.&lt;/li>
&lt;li>Follow on-screen instructions to set up a user account and configure your Ubuntu environment.&lt;/li>
&lt;li>Upon completion, you&amp;rsquo;ll have a fully functional Ubuntu terminal ready for use.&lt;/li>
&lt;/ol>
&lt;p>&lt;img src="https://sandramsc-fun.sandraashipala.workers.dev/image_3.png"
loading="lazy"
alt="Windows Features confirmation or restart prompt"
>&lt;/p>
&lt;h2 id="conclusion">Conclusion
&lt;/h2>&lt;p>Following these steps, you&amp;rsquo;ve successfully integrated Ubuntu into your Windows machine and can now navigate a Linux environment from your familiar Windows desktop.&lt;/p>
&lt;p>Thank you for reading. Happy Coding!&lt;/p></description></item><item><title>Git Commands</title><link>https://sandramsc-fun.sandraashipala.workers.dev/post/git-commands/</link><pubDate>Mon, 14 Aug 2023 00:00:00 +0000</pubDate><guid>https://sandramsc-fun.sandraashipala.workers.dev/post/git-commands/</guid><description>&lt;img src="https://sandramsc-fun.sandraashipala.workers.dev/post/git-commands/featured.jpg" alt="Featured image of post Git Commands" />&lt;p>&lt;strong>A quick guide - to keep handy&lt;/strong>&lt;/p>
&lt;h2 id="introduction">Introduction
&lt;/h2>&lt;p>Git is a powerful version control system that allows developers (and professionals who might benefit from the tool) to track changes, collaborate on projects, and manage code efficiently (you can learn more about version control here). In this post, we will cover a few of the most frequently used Git commands (at least the ones I use most often in development) and outline their basic functionalities.&lt;/p>
&lt;h2 id="list-of-git-commands">List of Git commands
&lt;/h2>&lt;h3 id="git-init">&lt;code>git init&lt;/code>
&lt;/h3>&lt;p>The &lt;code>git init&lt;/code> command initializes a new Git repository in your current working directory. It creates a hidden “.git” folder that contains the necessary data for version control.&lt;/p>
&lt;h3 id="git-clone-repository_url">&lt;code>git clone [repository_url]&lt;/code>
&lt;/h3>&lt;p>The &lt;code>git clone&lt;/code> command allows you to copy an existing Git repository from a remote source, such as GitHub. It downloads the entire repository, including its history, to your local machine.&lt;/p>
&lt;h3 id="git-add-files">&lt;code>git add [file(s)]&lt;/code>
&lt;/h3>&lt;p>The &lt;code>git add&lt;/code> command stages file(s) for the next commit. You can specify individual files or directories. Use &lt;code>git add .&lt;/code> , to stage all modified files in the current director.&lt;/p>
&lt;h3 id="git-status">&lt;code>git status&lt;/code>
&lt;/h3>&lt;p>The &lt;code>git status&lt;/code> command displays the current status of your repository. It shows which files have been modified, staged, or untracked. This command is helpful for understanding the state of your project.&lt;/p>
&lt;h3 id="git-log">&lt;code>git log&lt;/code>
&lt;/h3>&lt;p>The &lt;code>git log&lt;/code> command shows a chronological list of commits in the repository. It displays information such as the commit hash, author, date, and commit message. Use &lt;code>git log --oneline&lt;/code> for a more concise view.&lt;/p>
&lt;h3 id="git-pull-remotebranch">&lt;code>git pull [remote][branch]&lt;/code>
&lt;/h3>&lt;p>The &lt;code>git pull&lt;/code> command fetches and merges changes from a remote repository into your local branch. It is used to update your local branch with the latest changes made by others. Note that you’d need to specify the remote and branch to pull from.&lt;/p>
&lt;h3 id="git-branch">&lt;code>git branch&lt;/code>
&lt;/h3>&lt;p>The &lt;code>git branch&lt;/code> command lists all branches in your repository. It also highlights the branch you are currently on. Use &lt;code>git branch [branch_name]&lt;/code> to create a new branch.&lt;/p>
&lt;h3 id="git-checkout-branch_name">&lt;code>git checkout [branch_name]&lt;/code>
&lt;/h3>&lt;p>The &lt;code>git checkout&lt;/code> command combines changes from one branch into another. It integrates the changes from the specified branch into the current branch. This is useful when you want to incorporate features or bug fixes from one branch into another.&lt;/p>
&lt;h3 id="git-merge-branch">&lt;code>git merge [branch]&lt;/code>
&lt;/h3>&lt;p>The &lt;code>git merge&lt;/code> command combines changes from one branch into another. It integrates the changes from the specified branch into the current branch. This is useful when you want to incorporate features or bug fixes from one branch into another.&lt;/p>
&lt;h3 id="git-remote">&lt;code>git remote&lt;/code>
&lt;/h3>&lt;p>The &lt;code>git remote&lt;/code> command lists the remote repositories associated with your local repository. It shows their names, URL’s and other information. You can add new remotes using &lt;code>git remote add [name][url]&lt;/code>.&lt;/p>
&lt;h2 id="conclusion">Conclusion
&lt;/h2>&lt;p>Having an understanding of these commands will greatly enhance your ability to manage and collaborate on projects effectively. It can also be convenient to have these in one place so as to access them with ease when you need to.&lt;/p>
&lt;p>Thanks for reading. Happy Coding!&lt;/p></description></item></channel></rss>