Redirecting command output to two files

is it possible to redirect the output of a command, say cat, to two files simultaneously?

cire

You could cat and then cp.

ls -l | cat > test && cp test test2

or if you need to append to both files.

ls -l | cat >> test ; ls -l cat >> test2

I'm don't know of a way to append with cp and also I can't get a line where i can double pipe the output. Not really into bash scripting currently but it is a nice skill to have.

You could use tee. Example:

cat src_file | tee dst_file1 > dst_file2