
https://geek-university.com/linux/set-the-default-permissions-for-newly-created-files/
umask
그래서 이 경우에는 파일에 대한 비트 단위 권한과 폴더에 대한 기본 기본 권한을 0002
빼는 내 (명령)을 원합니다 . 예를 들어, 파일에 대한 결과는 664입니다.666
777
chmod
예를 들어 파일을 만들 때 기본 마스크인 새 마스크를 사용하여 만든 파일의 권한을 변경할 수 있습니다 touch
.
이 작업을 어떻게 수행할 수 있나요?
답변1
$ echo 'ibase=8; obase=8; (( 0666 - 0002 ))' | bc
644
$ echo 'ibase=8; obase=8; (( 0777 - 0002 ))' | bc
775