Skip to main content
added 28 characters in body
Source Link
Michael Durrant
  • 43.8k
  • 73
  • 176
  • 238

This:

ls > list

means redirect the output from the ls command to create a new file called list. If the file already exists, replace it.

Whereas

ls >> list

means redirect the output from the ls command and append it to the file called list If the file doesn't exist then create it.


Typically > is used when wiping out an existing file is ok. This often means that outputs continually overwrites a file based on the latest current state of things. For instance every time you test a program you might over-write the previous test output.

Typically >> is used for items such as logging events, parsing or other data processing where data is created or transformed piece by piece into a new form

This:

ls > list

means redirect the output from the ls command to create a new file called list. If the file already exists, replace it.

Whereas

ls >> list

means redirect the output from the ls command and append it to the file called list If the file doesn't exist then create it.

This:

ls > list

means redirect the output from the ls command to create a new file called list. If the file already exists, replace it.

Whereas

ls >> list

means redirect the output from the ls command and append it to the file called list If the file doesn't exist then create it.


Typically > is used when wiping out an existing file is ok. This often means that outputs continually overwrites a file based on the latest current state of things. For instance every time you test a program you might over-write the previous test output.

Typically >> is used for items such as logging events, parsing or other data processing where data is created or transformed piece by piece into a new form

added 28 characters in body
Source Link
Michael Durrant
  • 43.8k
  • 73
  • 176
  • 238

This:

ls > list

means redirect the output from the ls command to create a new file called list. If the file already exists, replacereplace it.

Whereas

ls >> list

means redirect the output from the ls command and appendappend it to the file called list If the file doesn't exist createthen create it.

This:

ls > list

means redirect the output from the ls command to a new file called list. If the file already exists, replace it.

Whereas

ls >> list

means redirect the output from the ls command and append it to the file called list If the file doesn't exist create it.

This:

ls > list

means redirect the output from the ls command to create a new file called list. If the file already exists, replace it.

Whereas

ls >> list

means redirect the output from the ls command and append it to the file called list If the file doesn't exist then create it.

Source Link
Michael Durrant
  • 43.8k
  • 73
  • 176
  • 238

This:

ls > list

means redirect the output from the ls command to a new file called list. If the file already exists, replace it.

Whereas

ls >> list

means redirect the output from the ls command and append it to the file called list If the file doesn't exist create it.