In some Linux systems, such as Fedora, when you add a new user, the user is assigned
to a group of the same name by default. For example, in the preceding text, the user
chris
would be assigned to the group chris. This approach to assigning groups is referred to as the
user private group scheme.
For now, type the following:
$ chmod 700 test
This step changes the permissions of the directory to give you complete access and every-
one else no access at all. (The new permissions should read as follows:
rwx------
.)
5.
Make the test directory your current directory as follows:
$ cd test
Using Metacharacters and Operators
To make efficient use of your shell, the bash shell lets you use certain special characters, referred to
as metacharacters and operators. Metacharacters can help you match one or more files without typ-
ing each file completely. Operators enable you to direct information from one command or file to
another command or file.
Identifying Directories
When you need to identify your home directory on a shell command line, you can use the following:
$HOME
-- This environment variable stores your home directory name.
~
-- The tilde (
~
) represents your home directory on the command line.
You can also use the tilde to identify someone else's home directory. For example,
~chris
would be
expanded to the
chris
home directory (probably
/home/chris
).
Other special ways of identifying directories in the shell include the following:
.
-- A single dot (
.
) refers to the current directory.
..
-- Two dots (
..
) refer to a directory directly above the current directory.
$PWD
-- This environment variable refers to the current working directory.
$OLDPWD
-- This environment variable refers to the previous working directory before you
changed to the current one.
NOTE
NOTE
69
Running Commands from the Shell
2