Linuxシステムプログラミング22ファイルシステム-ファイル属性とFATファイルシステム

1 umask
umask:パーミッション
ここに画像の説明を挿入
緩すぎるファイル防ぐためのumaskコマンドは、umask()でカプセル化されます。
Umaskはコードでも使用できます。

名前
のumask -セットファイル・モード作成マスク

概要
#include <sys / types.h>
#include <sys / stat.h>

   mode_t umask(mode_t mask);

2ファイルパーミッションの変更と管理

名前
chmod、fchmod、fchmodat-ファイルのパーミッションを変更します

概要
#include <sys / stat.h>

   int chmod(const char *pathname, mode_t mode);
   int fchmod(int fd, mode_t mode);

3スティッキングビット
tビットは
ルートディレクトリのtmpディレクトリdrwxrwxrwtなどの特定のディレクトリのtビットを設定するためによく使用されます。最後のビットはtビットであるため、各ユーザーはtmpディレクトリとファイルを操作できます。その中でより専門化されます。

mhr@ubuntu:~/work/linux/wenjianxitong/20$ 
mhr@ubuntu:~/work/linux/wenjianxitong/20$ ls / -l
total 100
drwxr-xr-x   2 root root  4096 Apr  8 22:58 bin
drwxr-xr-x   3 root root  4096 May  1 03:40 boot
drwxrwxr-x   2 root root  4096 Sep  2  2019 cdrom
drwxr-xr-x  18 root root  3980 May  3 08:50 dev
drwxr-xr-x 132 root root 12288 May  3 08:50 etc
drwxr-xr-x   3 root root  4096 Sep  2  2019 home
lrwxrwxrwx   1 root root    33 May  1 03:40 initrd.img -> boot/initrd.img-4.4.0-178-generic
lrwxrwxrwx   1 root root    33 May  1 03:40 initrd.img.old -> boot/initrd.img-4.4.0-177-generic
drwxr-xr-x  22 root root  4096 Sep  2  2019 lib
drwxr-xr-x   2 root root  4096 Apr  8 22:55 lib64
drwx------   2 root root 16384 Sep  3  2019 lost+found
drwxr-xr-x   4 root root  4096 Sep  2  2019 media
drwxr-xr-x   3 root root  4096 Sep  2  2019 mnt
drwxr-xr-x   2 root root  4096 Sep  2  2019 opt
dr-xr-xr-x 245 root root     0 May  3 08:49 proc
drwx------   3 root root  4096 Apr 23 05:34 root
drwxr-xr-x  26 root root   820 May  4 19:13 run
drwxr-xr-x   2 root root 12288 Apr  8 22:58 sbin
drwxr-xr-x   2 root root  4096 Apr  8 23:00 snap
drwxr-xr-x   2 root root  4096 Apr 20  2016 srv
dr-xr-xr-x  13 root root     0 May  3 08:49 sys
drwxrwxrwt  12 root root  4096 May  4 19:17 tmp
drwxr-xr-x  11 root root  4096 Apr 20  2016 usr
drwxr-xr-x  14 root root  4096 Apr 20  2016 var
lrwxrwxrwx   1 root root    30 May  1 03:40 vmlinuz -> boot/vmlinuz-4.4.0-178-generic
lrwxrwxrwx   1 root root    30 May  1 03:40 vmlinuz.old -> boot/vmlinuz-4.4.0-177-generic
mhr@ubuntu:~/work/linux/wenjianxitong/20$ 

4ファイルシステム:FAT UFS
ファイルシステム:ファイルまたはデータの保存と管理
追加予定...

おすすめ

転載: blog.csdn.net/LinuxArmbiggod/article/details/105928993