Red Hat ENTERPRISE LINUX 3 - STEP BY STEP GUIDE Manual page 56

Table of Contents

Advertisement

42
Those three sets are the owner of the file, the group in which the file belongs, and "others," meaning
other users on the system.
-
(rw-)
(rw-)
|
|
|
type
owner
group
The first item, which specifies the file type, can show one of the following:
— a directory
d
(dash) — a regular file (rather than directory or link)
-
— a symbolic link to another program or file elsewhere on the system
l
Beyond the first item, in each of the following three sets, you may see one of the following:
— file can be read
r
— file can be written to
w
— file can be executed (if it is a program)
x
(dash) — specific permission has not been assigned
-
When you see a dash in owner, group, or others, it means that particular permission has not been
granted. Look again at the first column of
ls -l sneakers.txt
-rw-rw-r--
1 sam sam
The file's owner (in this case, sam) has permission to read and write to the file. The group, sam, has
permission to read and write to
the group has permission to execute it.
3.13.1. The
chmod
Use the
command to change permissions. This example shows how to change the permissions
chmod
on
with the
sneakers.txt
The original file looks like this, with its initial permissions settings:
-rw-rw-r--
1 sam sam
If you are the owner of the file or are logged into the root account, you can change any permissions
for the owner, group, and others.
Right now, the owner and group can read and write to the file. Anyone outside of the group can only
read the file (
).
r--
Caution
Remember that file permissions are a security feature. Whenever you allow anyone else to read, write
to, and execute files, you are increasing the risk of files being tampered with, altered, or deleted. As
a rule, you should only grant read and write permissions to those who truly need them.
(r--) 1 sam sam
|
others
sneakers.txt
150 Mar 19 08:08 sneakers.txt
sneakers.txt
Command
command.
chmod
150 Mar 19 08:08 sneakers.txt
Chapter 3. Shell Prompt Basics
and identify its permissions.
, as well. It is not a program, so neither the owner or

Advertisement

Table of Contents
loading

This manual is also suitable for:

Enterprise linux 3

Table of Contents