Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to escape single quote while setting aliases

Tags:

bash

Want to create an alias of this command

find . -name '*.sh' -exec chmod a+x '{}' \;

and I am not able to escape the single quotes while setting the alias

alias mx='find . -name '*.sh' -exec chmod a+x '{}' \;'

Any help is appreciated.

like image 430
Sumit Avatar asked Feb 05 '11 21:02

Sumit


1 Answers

You could just use double quotes:

alias mx="find . -name '*.sh' -exec chmod a+x {} \;"

EDIT: Also, the single quotes ' around the {} is not necessary.

like image 108
atx Avatar answered Sep 19 '22 00:09

atx