Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

share|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 Z 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 Z Aug 25 '10 at 0:49

1 Answer 1

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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