I've found 2 slightly different syntaxes for redirecting the output of echo into a file on the shell: Code: echo "something" > file and Code: echo "something" >> file What's the difference between these 2 commands?
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
Echo to another server Just wondering how to echo to another (fingerprinted) server? Code: echo "something" >> user@server:file or Code: ssh user@server echo "something" >> file Doesn't seem to work..