title: How do I escape special characters in oh-my-zsh alias?
body: <p>So I am trying to create an alias that would list files in current directory like &quot;ls -lAh&quot; would, but only with specific columns that I want. So I've come up with this command:</p>
  <pre class="lang-sh prettyprint-override"><code>ls -lAh | awk 'BEGIN{FS=&quot; &quot;; OFS=&quot; &quot;} {print $6,$7,$8,$5,$9}'
  </code></pre>
  <p>This would only print columns that I need, which are date and time, file size and file name in that order.</p>
  <p>However if I want to create an alias for this command, I obviously need to escape a lot of characters so they get interpreted properly, but I am failing to do so. Sometimes when I put a backslash in front of a single quote or a dollar sign, it just breaks one way or the other and I can't make it work.</p>
  <p>Please help me understand how I'm supposed to escape the special characters so this gets interpreted correctly.</p>
  <p>In case it changes anything, I'm on MacOS. Please do ask for clarifications if needed.</p>
  <p>Edit:- Here is what I tried when attempting to actually create an alias:</p>
  <pre class="lang-sh prettyprint-override"><code>alias lah='ls -lAh | awk \'BEGIN\{FS=&quot; &quot;; OFS=&quot; &quot;\} \{print \$6,\$7,\$8,\$5,\$9}\''
  </code></pre>
  <p>I tried putting backslashes before every special character, on my first try I just put them before the single quotes, that didn't work and it was telling me something like <code>zsh: parse error at {</code>. Then I put a backslash before each curly brace, and that didn't work, apparently dollar signs are also special characters, so I put backslashes before those, but then whenever I press return after typing the command, it makes a new line that says <code>quote&gt;</code>, where I had to put a single quote to end the command, and when I do that it prints this: <code>zsh: command not found: \{print</code>.</p>