How to use STDIN and STDOUT in linux?
Go to solution
Solved by igormp,
Simply put, when you're running a program from the command line, anything that it spits out into your terminal is the content it wrote to STDOUT. Whatever you input into your terminal is the STDIN.
You can pass the STDOUT content of one program into the STDIN of another through pipes (represented by the operator | ), you can read more about it here.
One example would be:
echo hi | base64
Where "echo hi" would write something to the STDOUT, but, since we're using a pipe, it's actually being redirected as the STDIN to base64, which reads and and spits out the string "hi" as a base64 encoded string.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now