Unix File Permissions - Does Write Imply Read? Unix File Permissions - Does Write Imply Read? unix unix

Unix File Permissions - Does Write Imply Read?


Read, write, execute permissions in Unix/Linux are independent. It's possible to have write permissions without the read permission. For binary files, you might have seen that read permission isn't granted but execute permission enables you to execute it. On the other hand, a shell script or any other file that needs to be interpreted needs read permissions in order to execute.

Simply providing write permissions without read would enable you to write (also delete) the file without being able to read it.

The following should be self-explanatory:

$ touch foo$ ls -l foo-rw-rw-r-- 1 devnull devnull 0 Jul 19 12:00 foo$ chmod -r foo$ ls -l foo--w--w---- 1 devnull devnull 0 Jul 19 12:00 foo$ cat foocat: foo: Permission denied$ echo hey > foo$ ls -l foo--w--w---- 1 devnull devnull 4 Jul 19 12:00 foo$ cat foocat: foo: Permission denied$ > foo$ ls -l foo --w--w---- 1 devnull devnull 0 Jul 19 12:00 foo$ rm -f foo $ ls -l fools: cannot access foo: No such file or directory


A file can be a lot of things in unix-like systems. It might, for example be a pipeline, where a user might submit data to, but not receive data from. So no, a write permission does not imply read.

Another example might be a directory where the user can deposit data (potentially destroying existing data), but not read what others have deposited.


  1. You may be blind and still be able to write:

    $ touch a
    $ chmod 0200 a
    $ ls -ln a
    --w------- 1 1000 1000 4 Jul 19 15:13 a
    $ cat a
    cat: a: Permission denied
    $ echo "secret message" >> a
    $ chmod 0400 a
    $ cat a
    secret message

  2. Nope :)