Use the tee command:
tee
echo "hello" | tee logfile.txt
You can use >> to print in another file.
>>
echo "hello" >> logfile.txt