I know that if you have some alias with the name cp, you can bypass it using \cp.

Is this unix syntax? Are there any other uses of this syntax?

link|improve this question

1  
These sorts of things depend on which shell you're using, so it'd be really useful to know that. (There isn't really any such thing as "UNIX syntax") – David Zaslavsky Aug 24 '10 at 5:02
I am using tcsh. – Lazer Aug 24 '10 at 11:54
@David: The shell syntax that the OP posted works in most shells. – Dennis Williamson Aug 24 '10 at 15:17
@Dennis: Fair enough, I didn't know that. – David Zaslavsky Aug 25 '10 at 0:49
feedback

1 Answer

up vote 4 down vote accepted

It's a feature of the shell and seems to be common to both the Bourne shell family (sh, ksh, bash, zsh) and the C shell family (csh, tcsh). It's based on character escaping. By escaping the first character (actually you can escape any character) it prevents alias expansion from being performed.

$ alias cp='echo hello'
$ cp -v from to
hello -v from to
$ c\p from to
`from' -> `to'

Escaping is used a lot. For just a very brief introduction to a small part of the usefulness of escaping, see the Quoting section in man bash.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.