How to put text in multiple files using command echo?
I want to put same text in multiple files, but this command works on only one file:
echo "my text" > myfile.php
But I want a working command line for something like this:
echo "my text" > myfile.php,myfile.txt,myfile,myfile.html
How can I put text in multiple files or custom extension files?
The tee command copies what it reads from standard input to one or more files, and also writes the data to its standard output. So you can use:
echo my text | tee file1 file2 file3 > /dev/null
or maybe:
echo my text | tee file1 file2 > file3
echo your text | tee -a f1 f2 f3
-a for Append to the given FILEs. Do not overwrite. -I for Ignore interrupt signals.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With