What are shell metacharacters like \ and >?

What are shell metacharacters like \ and >?
Who is Participating?
'\' metacharacter gives special meaning to the next character
for example  a  "." ( dot) in a regular expression can mean any character but when preceded by a \ it means a literal dot .

>  redirects the standard output to a file .. say if you had a c program named test which had printfs
then typing

test > outfile
would print the output to the outfile instead of  the console

more metacharacters here

Add backslash before the characters to use them, if that is what you mean. Example:
$ ls | grep file

$ rm \\file

Same goes for other special characters.
1.  The backslash means that the next character should be used literally if it is a metacharacter.

2.  > is for redirection to a file

3.  ? is used by the shell to match a single character (similar to . in regex).  Remember that shell globs use some different characters to regexes for matching characters.
from man bash:
              A character that, when unquoted, separates words.  One of the following:
              |  & ; ( ) < > space tab
       control operator
              A token that performs a control function.  It is one of the following symbols:
              || & && ; ;; ( ) | <newline>

       Quoting is used to remove the special meaning of certain characters or words to the shell.  Quoting can be used  to  disable  special  treatment  for special characters, to prevent reserved words from being recognized as such, and to prevent parameter expansion.

       Each of the metacharacters listed above under DEFINITIONS has special meaning to the shell and must be quoted if it is to represent itself.

       When  the command history expansion facilities are being used, the history expansion character, usually !, must be quoted to prevent history expansion.

       There are three quoting mechanisms: the escape character, single quotes, and double quotes.

So the \ itself is no metacharacter for the shell, its just a quoting mechanism.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.