Are touch and chmod write operations? Are touch and chmod write operations? unix unix

Are touch and chmod write operations?


touch creates a zero byte file when called on a non-existent file. And it updates file's metadata based on the arguments passed. chmod does not change a file's data; it just changes the metadata contained in the file's inode.

However, the metadata itself is a part of the file system and hence it is a write operation.

In summary, both touch and chmod are write operations. They can't be run on a read-only file system.