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

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