CHMOD not working

Hi everyone!

I’m experimenting with “chmod” command. I try to run it here with the stat.docx but it doesn’t seem to make any change.

Any suggestion is welcome! Thank you!

Hey, Luis.

This is odd. It seems you’re on Windows using a Unix command-line. I wonder if this explains it somehow.

I did note the following. The date in the Change field isn’t “now”, it’s from January. It seems the changes are not occurring at all (as opposed to them occurring and being silently reverted or something).

What happens if you run chmod u+rwx,g+rw stat.docx instead?

What about if you run chmod 764 /mnt/c/Users/Luis/Desktop/EPFL/stat.docx?

Even if any of these work, it still doesn’t explain why what you ran didn’t work. I’ll try to reproduce this later in my Windows machine.

Thank you Bruno for your quick response.

Yes, I’m on Windows but I thought this was going to work using the ubuntu tool specified in the Dataquest course.
I tried your two suggestions but the same thing happens.

As I mentioned in another reply, this is happening because you’re on WSL.

It’s a consequence of the way WSL deals with files in the Windows file system. Further reading:

The third link gives us the solution, but the first two are more informative. Here’s what you have to do to be able to change permissions on Window’s filesystem.

  1. If /etc/wsl.conf doesn’t exist, create it.

  2. Add the following lines to /etc/wsl.conf:

    [automount]
    options = "metadata"
    
  3. Restart your WSL.

3 Likes