View Single Post
  #2  
Old 20th June 2005, 11:29
jojo jojo is offline
Junior Member
 
Join Date: Apr 2005
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Code:
echo "something" > file
means that everything that's in "file" will be deleted, and "something" will be written to it (which means that "something" will be right at the beginning of "file".

Code:
echo "something" >> file
means that "something" will be appended to "file", so nothing will be deleted from "file", and "something will be at the end of "file".

"file" will be created if it doesn't exist in both cases.

A little example:

We have the file "file" with the following contents:

Code:
line 1
line 2
line 3
Now when you execute the command

Code:
echo "something" > file
the content of "file" will be

Code:
something
When you run

Code:
echo "something" >> file
instead, the content of "file" will be

Code:
line 1
line 2
line 3
something
jojo
Reply With Quote