How to create a directory and give permission in single command

poorani picture poorani · Apr 26, 2011 · Viewed 244.3k times · Source

How to create a directory and give permission in single command in Linux?

I have to create lots of folder with full permission 777.

Commands

mkdir path/foldername
chmod 777 path/foldername 

I don't like to create and give permission in two commands. Can I do this in single command?

Answer

alex picture alex · Apr 26, 2011

According to mkdir's man page...

mkdir -m 777 dirname