Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I tried to prevent my digital photos (.jpg files) from accidental deletion using chmod 444 *.jpg. All permissions are set and displayed correctly in a terminal (ls -la) as well as in thunar's file properties > permissions. The files are displayed with a lock symbol. Even though, whenever I press "delete", the marked file is moved to trash. My expectation was that files without write permission could not be moved to trash. Is it a bug or am I just wrong assuming that moving a file requires write permission?

share|improve this question

1 Answer 1

Actually, Nautilus behaves the same (as does bash terminal). You can delete a read-only file, because it is the directory permissions that control that operation. In theory, you can't write to a read-only file, although many editors will delete the original (or make a backup), then write to a new file, so it seems that you can write to the read-only file.

If you were to make the permissions for a directory r-x, then you would not be able to delete any files (but you could still write to the files, assuming they are not read-only).

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.