Text in the terminal can be redirected to log files instead of the screen. Find out how to redirect and pipe text.
- [Narrator] It can be useful to change where the output…from a command goes.…This is called redirection, and we can redirect text…both into and out of a command.…We can also use what are called pipes to send…the output one command to another command as input.…To start with, let's use the echo command,…which takes text as an input and just returns it…back to us as an output like this.…I'll write echo some text.…If I want the response to go somewhere…other than the terminal output here,…which is called the standard output,…I can use a greater than sign to send it to a file.…
I'll write echo "some text" > output.txt.…I don't get any response now,…and if I write cat output.txt,…I can see that the output that I would have seen…at the terminal is inside this file instead.…If were to echo something else to the file,…and then take a look at that again,…that information has completely replaced…what was there before.…
That's because the single greater than operator…replaces the contents of files,…but you can use the double greater than operator…
- Exploring filesystems
- Installing Linux on a physical or virtual machine
- Working with files, directories, and links
- Finding files
- Handling input/output redirection
- Comparing text files and non-text files
- Compressing and decompressing files
- Configuring file permissions
- Managing the root account
- Accessing the command line remotely
- Transferring files
Skill Level Beginner
1. Install and Log Into Ubuntu
System documentation11m 21s
2. Working with Files in the Terminal
3. Security and Administration
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.