Mr Mystery Guest
Mr Mystery Guest

Reputation: 1474

How is >> called?

I've found out what the difference between > and >> is.

My question is this: In the context of command line code, what is >> called?

As in:

dir *.txt >> mytext.txt

Double chevron? Pipe to? Over-write?

Upvotes: 2

Views: 765

Answers (5)

aschipfl
aschipfl

Reputation: 34919

In the context of , I prefer using the term output redirection for both > and >>, because the output of a command is redirected. To distinguish between them, I specifically use:

  • > -- output redirection in overwrite mode;
  • >> -- output redirection in append mode;

For the sake of completeness, for < I use the term input redirection. The | is called a pipe.

Upvotes: 0

JosefZ
JosefZ

Reputation: 30123

As > is called Greater than then >> could be Double Greater than

BTW,

  • chevron is rare programmer's name for inverted V-shaped symbol ^ Circumflex Accent (other time called caret athough caret is another symbol) and
  • chevrons is another name for 〈 〉angle brackets, pointy brackets, triangular brackets, diamond brackets, or tuples; (hard to type that symbols from computer keyboard).

Here's a PowerShell output from Unicode database:

PS D:\PShell> '^<>〈〉‸'| Get-CharInfo | Format-Table -AutoSize

Char  CodePoint         Category Description        
----  ---------         -------- -----------        
   ^  U+005E      ModifierSymbol Circumflex Accent  
   <  U+003C          MathSymbol Less-Than Sign     
   >  U+003E          MathSymbol Greater-Than Sign  
   〈 U+3008     OpenPunctuation Left Angle Bracket 
   〉 U+3009    ClosePunctuation Right Angle Bracket
   ‸  U+2038    OtherPunctuation Caret              

Upvotes: 1

abelenky
abelenky

Reputation: 64682

I personally call it the "Append To", but don't have any source to back that up.

Examples:

dir *.txt >> Output.txt   ("list text files, Appended To output.txt")
dir *.txt > Output.txt    ("list text files, Redirected to output.txt")

Upvotes: 4

Ranadip Dutta
Ranadip Dutta

Reputation: 9133

It is known as redirection .

Basically input redirection. >> indicates an append in the file ,whereas, > indicates a new file creation if you are using redirection followed by a file name.

Different programming languages have different usage like in Python >> is Binary Right Shift and << is Binary left Shift

In Postgresql , it is used for picking the vale as text or integer from an array element if the structure is json.

One more thing, symbolically it is known as chevron and double-chevron.

Hope it helps.

Upvotes: 0

Luke Shinn
Luke Shinn

Reputation: 346

The ">>" syntax will create an output to a new file. If the file to the right of the arrows is already created, it will add whatever you're trying to add to the end of the file.

Upvotes: 0

Related Questions