Single command to create a file and set its permission

后端 未结 8 1149
北恋
北恋 2021-01-31 08:23

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 w

8条回答
  •  不思量自难忘°
    2021-01-31 08:43

    touch filename.ext && chmod 777 $_

    $_ is the most recent parameter

    but as others have said 777 isn't a good idea

提交回复
热议问题