Most Linux configuration files are plain text and we can use cat to view them. If text files are long, we can view them one page at a time with a pager.
- [Instructor] Any command output that goes to the screen…can be saved as a file using a redirect,…as well as sent to other commands using a pipe.…Let's redirect the output of a command to a file.…For this demonstration we'll use the journalctl command…that shows system messages.…If we type in journalctl,…we can see that it shows a lot of useful information…that we might want to save somewhere.…Press Q to quit.…Type in journalctl again.…Space, greater than symbol, and then name the file…journal.txt.…Hit enter.…
Notice no output went to the screen.…If we use the cat command to read this file…we'll see that the output is in the file.…The cat command is a very simple way of viewing a text file.…If you want to view the file in reverse order,…you could type in tac, space journal.txt and hit enter.…Tac is cat backwards.…If you like to sort the file you could just type in sort…journal.txt and it'll sort it in alphabetical order.…You might notice that cat views the whole file…and it scrolls off the screen.…
It might be nice to view the file one page at a time…
- Learning Linux command syntax
- Getting help on the CLI and GUI
- Finding help online
- Using basic commands
- Navigating file systems
- Editing text
Skill Level Intermediate
Linux: Bash Shell and Scriptswith Kevin Dankwardt2h 46m Intermediate
Setting up a Red Hat Enterprise Linux Serverwith Sandra Toner2h 46m Intermediate
1. Getting Help
2. Using Basic Commands
3. Navigating File Systems
4. Editing Text
- 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.