-
Set default permissions for files and directories in Linuxlinux 2023. 2. 21. 10:13
umask is a command used in Unix-based operating systems to set the default permissions for new files and directories created by the current user or process. The value of umask is subtracted from the maximum permission value (usually 777 for directories and 666 for files) to determine the default permission value.
Here's an umask option table:
OptionDescription
-S Display the umask value in symbolic form. -p Display the umask value in octal form. -f Display the umask value in file mode notation. Here are some examples of umask usage:
- Display the current umask value in symbolic form:
umask -SOutput:
u=rwx,g=rx,o=rx- Set the umask value to 022 in octal form:
umask 022- Set the umask value to 002 in symbolic form:
umask u=rwx,g=rwx,o=rx- Display the current umask value in file mode notation:
umask -fOutput:
0022'linux' 카테고리의 다른 글
How to search file in Linux (0) 2023.02.21 File permissions in Linux (0) 2023.02.21 What is inode (0) 2023.02.20 File addressing in Linux (0) 2023.02.20 How to display file contents in linux (cat) (0) 2023.02.20