Installation guide
116 Chapter 11. Shell Prompt Basics
Remember that commands are case sensitive, so the command to start Mozilla must be in lowercase
to start the browser. You will see something like this:
[sam@halloween sam]$date; mozilla; date
Mon Feb 7 13:26:27 EST 2000
A second date entry appears when you close out of Mozilla.
[sam@halloween sam]$date; mozilla; date
Mon Feb 7 13:26:27 EST 2000
Mon Feb 7 14:28:32 EST 2000
[sam@halloween sam]$
The discrepancy between the two results from the date command shows that you were using Mozilla
for just over an hour.
11.14. Ownership and Permissions
Earlier in this chapter, when you tried to cd to root’s login directory, you received the following
message:
[sam@halloween sam]$cd /root
bash: /root: Permission denied
[sam@halloween sam]$
That was one demonstration of Linux’s security features. Linux, like UNIX, is a multi-user system,
and file permissions are one way the system protects against malicious tampering.
One way to gain entry when you are denied permission is to su to root, as you learned earlier. This is
because whoever knows the root password has complete access.
[sam@halloween sam]$su
Password: your root password
[root@localhost sam]#cd /root
[root@localhost /root]#
But switching to superuser is not always convenient, or wise, since it is easy to make mistakes and
alter important configuration files.
All files and directories are "owned" by the person who created them. You created the file sneak-
ers.txt (see Section 11.9.1) in your login directory, so sneakers.txt "belongs" to you.
That means you can specify who is allowed to read the file, write to the file, or (if it is an application
instead of a text file) who can execute the file.
Reading, writing, and executing are the three main settings in permissions. Since users are placed into
a group when their accounts are created, you can also specify whether certain groups can read, write
to, or execute a file.
Take a closer look at sneakers.txt with the ls command using the -l (long) option (see Figure
11-9).
[sam@halloween sam]$ls -l sneakers.txt
-rw-rw-r-- 1 sam sam 150 Mar 19 08:08 sneakers.txt
There is a lot of detail provided here. You can see who can read (r) and write to (w) the file, as well as
who created the file (sam), and to which group the owner belongs (sam). Remember that, by default,
the name of your group is the same as your login name.