From the course: Learning Linux Command Line
Unlock the full course today
Join today to access over 23,100 courses taught by industry experts.
View text files with cat, head, tail, and less - Linux Tutorial
From the course: Learning Linux Command Line
View text files with cat, head, tail, and less
- [Instructor] Because a lot of what we'll be working with at the command line involves text files or text output, it's important to have a few tools in our toolkit to view the contents of text files. The first one I want to introduce is called cat and it's short for concatenate. To concatenate means to stick two or more things together. And the cat command can do that, but it's often just used to print the contents of a file to the screen. It's also helpful to get the contents of a text file into a series of piped commands. Depending on the operating system we're using, we'll have different files available to us. Normally we'd use cat to look at a log file or something like that, but here I'll use some classic poems because I want you to be able to follow along with me exactly and not get tied up in the differences between Linux distributions at this point. To list out the contents of a file, I'll write cat followed by…
Contents
-
-
-
-
-
-
The Unix philosophy2m 29s
-
(Locked)
Use pipes to connect commands together2m 41s
-
(Locked)
View text files with cat, head, tail, and less4m 44s
-
(Locked)
Search for text in files and streams with grep4m 30s
-
(Locked)
Manipulate text with awk, sed, and sort6m 50s
-
(Locked)
Edit text with Vim4m 35s
-
(Locked)
Edit text with nano2m 49s
-
(Locked)
Working with tar and zip archives8m 17s
-
(Locked)
Challenge: Create and share a file28s
-
(Locked)
Solution: Create and share a file1m 48s
-
(Locked)
Output redirection5m 11s
-
(Locked)
Exploring environment variables and PATH3m 54s
-
(Locked)
Challenge: Extract information from a text file1m 8s
-
(Locked)
Solution: Extract information from a text file3m 28s
-
-
-