Quick Reference to file sharing
“Permission denied.”
If this error appears when you try to read the file, you don’t have read permission. If the error appears as you try to save the file, you don’t have write permission:
See who owns the file:
% ls -l filenameAsk the owner for read/write permission.
If the owner isn’t available, ask your system administrator to change the file permissions.
If you have read permission, you can copy the file into your own directory and work on it there; e.g., to copy a file named memo to your own directory:
% cp memo ~/memo.mine
Be sure to tell the owner that you made changes to a copy of the file.
Repeated denial to files that you think you should be able to share
See what group can read/write the files:
% ls -lg filenamesSee what groups you are a member of:
% groups
If you are not a member of the group with permission, ask the file owner to change the group to one you belong to or ask your system administrator to add you to the group.
Can’t create or remove files in a directory
Check directory permissions on the directory:
% ls -ld directoryAsk the directory’s owner to give you permission:
How to change permissions
Check the file’s permissions, owner, and group:
% ls -lgIf you are the file’s owner, use chmod. E.g., to add write permission to all for a file named memo:
% chmod a+w memoTo add permissions for all users:
% chmod a+r memo read permission % chmod a+w memo write permission % chmod a+rw memo read/write
To add permissions for the group:
% chmod g+r memo ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access