Terminal thinks "nano" is "open" in a command I put in .bash_profile (mac)
<p>I've made a bunch of commands to use as shortcuts and they work but I wanted to make a command that would shortcut and open the in-terminal text editor, nano, with the .bash_profile.</p>

<p>Essentially instead of typing </p>

<pre><code>sudo nano /Users/myUserName/.bash_profile
</code></pre>

<p>(the sudo is so I can save edits)</p>

<p>I want a command that I put in the .bash_profile to do that for me, manually adding this line of code to it:</p>

<pre><code>alias commands='sudo nano /Users/myUserName/.bash_profile'
</code></pre>

<p>The problem is, when I run the command it just opens the file in textedit and it's a locked file meaning I can't edit.</p>

<p>Is there a way to do this?</p>