Thursday, November 30, 2017

Echo into a file

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".

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.

No comments:

Post a Comment