How do I append the output of a command to the end of a text file?

12 s
12

Use >> instead of > when directing output to a file:

your_command >> file_to_append_to

If file_to_append_to does not exist, it will be created.

Example:

$ echo "hello" > file
$ echo "world" >> file
$ cat file 
hello
world

Tags:

Leave a Reply

Your email address will not be published. Required fields are marked *