All Questions

Tagged with
Filter by
Sorted by
Tagged with
28
votes
1answer
21k views

Append same text to many files using cat or echo?

How can I write the same content to many text files by using cat or echo in only one command? For example I want to write "hello" to file1 and file2. I tried: echo "hello" >> file1 file2 but ...
13
votes
2answers
22k views

Unexpected results testing serial loopback using echo and cat

So I have a standard RS232 serial port that is looped back to itself by simply running a wire from Tx to Rx. I'm testing loopback by running echo and cat in two separate terminals: cat /dev/ttyS1 ...
15
votes
7answers
5k views

Why there is such a difference in execution time of echo and cat?

Answering this question caused me to ask another question: I thought the following scripts do the same thing and the second one should be much faster, because the first one uses cat that needs to open ...
2
votes
2answers
5k views

Difference between 'cat < file.txt' and 'echo < file.txt' [duplicate]

I have a file named file.txt which has some content say 'abcdef', when I do cat < file.txt I get the output abcdef but when I do echo < file.txt, no output is returned. Why doesn't the input ...