<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/"
    xmlns:atom="http://www.w3.org/2005/Atom" xmlns:media="http://search.yahoo.com/mrss/" version="2.0">
    <channel>
        
        <title>
            <![CDATA[ nano - freeCodeCamp.org ]]>
        </title>
        <description>
            <![CDATA[ Browse thousands of programming tutorials written by experts. Learn Web Development, Data Science, DevOps, Security, and get developer career advice. ]]>
        </description>
        <link>https://www.freecodecamp.org/news/</link>
        <image>
            <url>https://cdn.freecodecamp.org/universal/favicons/favicon.png</url>
            <title>
                <![CDATA[ nano - freeCodeCamp.org ]]>
            </title>
            <link>https://www.freecodecamp.org/news/</link>
        </image>
        <generator>Eleventy</generator>
        <lastBuildDate>Wed, 26 Aug 2026 20:17:51 +0000</lastBuildDate>
        <atom:link href="https://www.freecodecamp.org/news/tag/nano/rss.xml" rel="self" type="application/rss+xml" />
        <ttl>60</ttl>
        
            <item>
                <title>
                    <![CDATA[ How to Save and Exit Nano in Terminal – Nano Quit Command ]]>
                </title>
                <description>
                    <![CDATA[ Nano is a command line-based code editor known for its simplicity compared to other editors like Vim and Emacs. But if you are new to Nano, performing basic operations like creating files, saving the file, and exiting the editor might be confusing.  ... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/how-to-save-and-exit-nano-in-terminal-nano-quit-command/</link>
                <guid isPermaLink="false">66adf1437550d4f37c2019b1</guid>
                
                    <category>
                        <![CDATA[ editor ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Linux ]]>
                    </category>
                
                    <category>
                        <![CDATA[ nano ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Kolade Chris ]]>
                </dc:creator>
                <pubDate>Tue, 26 Jul 2022 16:57:06 +0000</pubDate>
                <media:content url="https://www.freecodecamp.org/news/content/images/2022/07/nano.png" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>Nano is a command line-based code editor known for its simplicity compared to other editors like Vim and Emacs.</p>
<p>But if you are new to Nano, performing basic operations like creating files, saving the file, and exiting the editor might be confusing. </p>
<p>So, in this article, I want to show you how to save your code in Nano and exit it as well.</p>
<p>I’ll be using the Windows Subsystem for Linux (WSL) in this article. But it’s fine if you’re on Linux itself. The commands are the same.</p>
<h2 id="heading-what-well-cover">What We'll Cover</h2>
<ul>
<li><a class="post-section-overview" href="#heading-how-to-save-a-file-in-nano">How to Save a File in Nano</a></li>
<li><a class="post-section-overview" href="#heading-how-to-exit-nano">How to Exit Nano</a></li>
<li><a class="post-section-overview" href="#heading-wrapping-up">Wrapping Up</a></li>
</ul>
<h2 id="heading-how-to-save-a-file-in-nano">How to Save a File in Nano</h2>
<p><strong>Step 1</strong>: Open WSL, type “nano” and hit <code>ENTER</code> to get into the Nano code editor
<img src="https://www.freecodecamp.org/news/content/images/2022/07/ss1-4.png" alt="ss1-4" width="600" height="400" loading="lazy"> </p>
<p><strong>Step 2:</strong> Write your code in any language. In the screenshot below, I wrote some PHP.
<img src="https://www.freecodecamp.org/news/content/images/2022/07/ss2-5.png" alt="ss2-5" width="600" height="400" loading="lazy"> </p>
<p><strong>NB:</strong> If you don’t get syntax highlighting, enable it by pressing <code>ALT</code> + <code>4</code>. If you still don’t get syntax highlighting, then you need to save the file.</p>
<p><strong>Step 3:</strong> Press <code>CTRL</code> + <code>O</code> to save the file, type the file name, and hit <code>ENTER</code>.
<img src="https://www.freecodecamp.org/news/content/images/2022/07/ss3-4.png" alt="ss3-4" width="600" height="400" loading="lazy"> </p>
<p>Now, syntax highlighting is enabled:
<img src="https://www.freecodecamp.org/news/content/images/2022/07/ss4-4.png" alt="ss4-4" width="600" height="400" loading="lazy"> </p>
<p>If you already opened the file by typing <code>nano file_name</code> in WSL… </p>
<p>When you are done making your changes, press <code>CTRL + O</code> and hit <code>ENTER</code> to save the changes.
<img src="https://www.freecodecamp.org/news/content/images/2022/07/save-exit-nano.gif" alt="save-exit-nano" width="600" height="400" loading="lazy"> </p>
<h2 id="heading-how-to-exit-nano">How to Exit Nano</h2>
<p>To exit nano, all you need to do is to press <code>CTRL</code> + <code>X</code>.
<img src="https://www.freecodecamp.org/news/content/images/2022/07/ss5-5.png" alt="ss5-5" width="600" height="400" loading="lazy"> </p>
<p>If you have any changes that have not been saved, you’ll be prompted to save the changes before you quit the editor.
<img src="https://www.freecodecamp.org/news/content/images/2022/07/save-nano.gif" alt="save-nano" width="600" height="400" loading="lazy"></p>
<h2 id="heading-wrapping-up">Wrapping Up</h2>
<p>I hope this article helped you learn how to save a file in Nano and exit the editor whenever you want to.</p>
<p>Don’t forget:</p>
<ul>
<li>Typing <code>nano</code> gets you into the Nano editor in WSL</li>
<li><code>CTRL</code> + <code>O</code> saves a Nano file</li>
<li><code>CTRL</code> + <code>X</code> exits Nano</li>
</ul>
<p>Thank you for reading. If you find the article helpful, don’t hesitate to share it with your friends and family.</p>
 ]]>
                </content:encoded>
            </item>
        
    </channel>
</rss>
