Redirecting Input and Output
Learn to redirect input and output to and from files and programs.
StartKey Concepts
Review core concepts you need to learn to master this subject
Append Redirect shell command
Pipe shell command
Redirecting Output
cat
Display
grep
Search
Case insensitive search
grep -R shell command
Command Line Redirection
Append Redirect shell command
Append Redirect shell command
# This command will append "Hello World!" to greetings.txt
echo "Hello World!" >> greetings.txt
The >>
shell command is used to redirect the standard output of the command on the left and append (add) it to the end of the file on the right.
Redirection
Lesson 1 of 1
- 1Up until now, we have run commands in the command line and received a stream of output in the terminal. In this lesson, we’ll focus on input and output (I/O) redirection. Through redirection yo…
- 2How does redirection work? $ echo “Hello” > hello.txt The > command redirects the standard output to a file. Here, “Hello” is entered as the standard input, and is then redirected to the file **…
What you'll create
Portfolio projects that showcase your new skills
How you'll master it
Stress-test your knowledge with quizzes that help commit syntax to memory