0

I'm trying to learn Linux essentials on WSL. I tried to change permission for a test file and it didn't work as I expected.

$ stat test.sh

  File: test.sh
  Size: 1616            Blocks: 8          IO Block: 4096   regular file
Device: eh/14d  Inode: 93168217291239796  Links: 1
Access: (0777/-rwxrwxrwx)  Uid: ( 1000/merajmasuk)   Gid: ( 1000/merajmasuk)
Access: 2019-11-25 01:42:24.306619600 +0600
Modify: 2019-11-25 01:42:24.306619600 +0600
Change: 2019-11-25 12:44:11.615101900 +0600
 Birth: -

$ chmod 444 test.sh
$ stat test.sh

  File: test.sh
  Size: 1616            Blocks: 8          IO Block: 4096   regular file
Device: eh/14d  Inode: 93168217291239796  Links: 1
Access: (0555/-r-xr-xr-x)  Uid: ( 1000/merajmasuk)   Gid: ( 1000/merajmasuk)
Access: 2019-11-25 01:42:24.306619600 +0600
Modify: 2019-11-25 01:42:24.306619600 +0600
Change: 2019-11-25 12:49:02.544253700 +0600
 Birth: -

As you can see, I tried to apply the permission 444, here 555 was applied. Another example,

$ stat test.sh

  File: test.sh
  Size: 1616            Blocks: 8          IO Block: 4096   regular file
Device: eh/14d  Inode: 93168217291239796  Links: 1
Access: (0555/-r-xr-xr-x)  Uid: ( 1000/merajmasuk)   Gid: ( 1000/merajmasuk)
Access: 2019-11-25 01:42:24.306619600 +0600
Modify: 2019-11-25 01:42:24.306619600 +0600
Change: 2019-11-25 12:49:02.544253700 +0600
 Birth: -

$ chmod 711 test.sh
$ stat test.sh

  File: test.sh
  Size: 1616            Blocks: 8          IO Block: 4096   regular file
Device: eh/14d  Inode: 93168217291239796  Links: 1
Access: (0777/-rwxrwxrwx)  Uid: ( 1000/merajmasuk)   Gid: ( 1000/merajmasuk)
Access: 2019-11-25 01:42:24.306619600 +0600
Modify: 2019-11-25 01:42:24.306619600 +0600
Change: 2019-11-25 12:52:27.316596700 +0600
 Birth: -

Which, again you can see, doesn't work correctly.

I looked at this question but it didn't help me. I found a similar post (as my machine uses NTFS partition and the file is inside /mnt) on AskUbuntu but I found it too complex for me.

0 Answers0