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

Christine Martino
Christine Martino
16,837 Points

If the -r flag stands for "recursive", what does the -p flag in mkdir -p actually stand for?

Knowing the meaning behind certain shorthand command names just helps me remember what they do, and I hear it called out in the video. :)

1 Answer

Ken Alger
STAFF
Ken Alger
Treehouse Teacher

Christine;

Great question!

The -p flag creates parent directories as needed. Here's an example:

Create both a parent directory called treehouse and it's child directory called courses at the same time. Assume that directory treehouse will branch-off your home directory and that you are in your home directory to start. Use a relative pathname.

You would want to use the -p flag here. The syntax would be:

mkdir -p treehouse/courses

That assumes that you are already in your home directory and have write permissions in that directory.

Hope that helps, post back with additional questions.

Ken

Christine Martino
Christine Martino
16,837 Points

Sweet! Thanks for the super-quick answer! You guys rock!!