Read from standard input
suggest changecat < file.txt
Output is same as cat file.txt
, but it reads the contents of the file from standard input instead of directly from the file.
printf "first line\nSecond line\n" | cat -n
The echo command before |
outputs two lines. The cat command acts on the output to add line numbers.
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents