3.1. Input as cat - JulTob/OperatingSystems GitHub Wiki

You've seen cat being used to read the contents of files but it can also be used to read the standard-input and send it back to standard output.

$ cat
Hello
>>> Hello

To finish reading from the input stream close the input stream by pressing CTRL-D

You can use cat to get input from user and redirect to a file.

$ cat > myprog.c
#include <stdio.h>
int main() {printf("Hi!");return 0;}
⚠️ **GitHub.com Fallback** ⚠️