A file Cat
within a folder Dog
owner
-rw- 1 rich v 12 15:40 Cat
What is the shell command to remove others' read access from file Dog
?
A file Cat
within a folder Dog
owner
-rw- 1 rich v 12 15:40 Cat
What is the shell command to remove others' read access from file Dog
?
You can change file permissions with the chmod
command.
There are two basic ways of using chmod
to change file permissions:
Symbolic Method:
In the symbolic method to remove read and write permission for other users on a subdirectory named Dog
, you should enter:
chmod o-rw Dog
Absolute form:
In the absolute method to do the same, you should enter:
chmod 700 Dog
for read, write, execute permissions only for the owner and not for the group and other users.
In this method you can customize the access permissions more efficiently as per your requirements.
Be careful when setting the permissions of directories, particularly your home directory; you don't want to lock yourself out by removing your own access. Also, you must have the execute permission on a directory to switch (cd) to it.
For further reading and additional information about file permissions.
man chmod
) – steeldriver Mar 28 '19 at 18:24cat
orCat
, and what isDog
? A file, a folder (which is a file as well in the end), …? – dessert Mar 28 '19 at 19:07