Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Development Tools Git Basics Getting Started With Git Looking Back on What We've Done

What is the cat tool?

Tommy intro'ed the cat tool but didn't explain what this is...can someone elaborate? Thanks!

3 Answers

William Li
PLUS
William Li
Courses Plus Student 26,868 Points

cat is a UNIX utility that reads file's content and output it on the screen.

Say, for example. There's a sample.txt file in your current directory, this file contains the following text.

Lorem ipsum dolor sit amet, consectetur adipiscing elit, 
sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. 
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. 
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. 
Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

When executing the command cat sample.txt, the above text block will be outputted on the Console screen.

That's how most people use cat, it's a pretty simple UNIX utility, but like all UNIX utilities, cat comes with its own set of [options] & [flags], and can pipeline w/ other utilities for doing more complex thing, you may check out cat's man page documentation for more details.

But where can we look up the details for the cat command? And not only the cat command is there any resource for that?

Thank you...

Oh. That's helpful....