I\'ve a command that works just fine at the command line, but not when I try to put it in an alias or function.
$ awk \'{print $1}\' /tmp/textfile 0 <
$ awk \'{print $1}\' /tmp/textfile 0
You need to escape the $ like so:
$
alias a="awk '{print \$1}' /tmp/textfile"
Otherwise your alias is:
awk '{print }' /tmp/textfile
Which prints the whole file...