Read from standard input

suggest change
cat < 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.

Feedback about page:

Optional: your email if you want me to get back to you:

Table Of Contents