Standard Streams Lab for Coursera
Let's practice working with Bash Streams
- Run the following command in your Bash terminal:
echo "fruit" > meal.txt
- Read the output of the file using the cat command:
cat meal.txt
- Explain what happened?
- Run the following command in your Bash terminal:
echo "chocolate" >> meal.txt
- Read the output of the file using the cat command:
cat meal.txt
- Explain what happened?
- How could you write more data to the file?
- Use the
tr
command to substitute characters by reading standard input:tr fruit steak < meal.txt
- What output do you see?
- Could you improve this result? How?
- Send the output of standard out to /dev/null via
cat meal.txt > /dev/null
- Explain what happened?
- Why would you want to send the output of a command to
/dev/null
?