escaping single quotes inside an alias in bash
问题 I am trying to set up an alias in my .bashrc file like the below: clear && printf '\033[3J' But the following does not work alias clall= "clear && printf \'\033[3J\'" alias clall= "clear \&\& printf \'\\033\[3J\'" 回答1: The general rule about aliases is that if you have a question about how to use them (or whether they're capable enough for your purpose), you should be using a function instead. A function gives you all the capability (considerably more, for that matter), and doesn't require