>
はリダイレクト演算子です。 < > >| << >> <& >& <<- <>
はすべてシェルコマンドインタープリタのリダイレクト演算子です。
例では、実質的に>
が上書きされ、>>
が上書きされます。
man sh
(端末からは、man sh
経由でマニュアルにアクセスできます)を参照してください。
Redirections
Redirections are used to change where a command reads its input or sends its output. In
general, redirections open, close, or duplicate an existing reference to a file. The over‐
all format used for redirection is:
[n] redir-op file
where redir-op is one of the redirection operators mentioned previously. Following is a
list of the possible redirections. The [n] is an optional number, as in '3' (not '[3]'),
that refers to a file descriptor.
[n]> file Redirect standard output (or n) to file.
[n]>| file Same, but override the -C option.
[n]>> file Append standard output (or n) to file.
[n]< file Redirect standard input (or n) from file.
[n1]<&n2 Duplicate standard input (or n1) from file descriptor n2.
[n]<&- Close standard input (or n).
[n1]>&n2 Duplicate standard output (or n1) to n2.
[n]>&- Close standard output (or n).
[n]<> file Open file for reading and writing on standard input (or n).
The following redirection is often called a "here-document".
[n]<< delimiter
here-doc-text ...
delimiter
All the text on successive lines up to the delimiter is saved away and made available to the
command on standard input, or file descriptor n if it is specified. If the delimiter as
specified on the initial line is quoted, then the here-doc-text is treated literally, other‐
wise the text is subjected to parameter expansion, command substitution, and arithmetic
expansion (as described in the section on "Expansions"). If the operator is "<<-" instead
of "<<", then leading tabs in the here-doc-text are stripped.
[>との違い>>ログファイルの作成中]の可能な重複(http://stackoverflow.com/questions/34649227/difference-between-and-while-creating-log-file) –