Single command to create a file and set its permission

user3075776 picture user3075776 · Jan 24, 2014 · Viewed 38.6k times · Source

I am using the following 2 commands to create a 0B file and set its extn to 644

touch filename.ext
chmod 777 filename.txt

My question is that whether there is any single command in unix (korn shell) that will do the two things together that is to say create a 0B fil with desired permission?

Answer

proski picture proski · Oct 28, 2016
install -m 777 /dev/null filename.txt