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

Cat hello.txt permission denied

I keep running cat hello.txt and the result is "permission denied". Why is this?

3 Answers

Navigate to the folder where your hello.txt file is and type ls -l. This will bring up a list of the files in that folder with a list of your permissions. It's read like "rwx rwx rwx" where the first triplet of rwx are your permissions (assuming you own that file).

Because cat hello.txt is trying to read the file you will need to have the r permission set.

I found the problem. it was listed under a different user, but thanks though!

Chris Sunde
Chris Sunde
10,680 Points

In the "Permissions" training, we changed the owner to "mike" instead of "treehouse", so once we get to the "Find and Grep" training, our permission gets denied.

To reset the owner to "treehouse", type in the command line:

sudo chown treehouse hello.txt