Your home directory is part of a fairly large directory tree which contains all user accounts, system files, and output devices.
The following commands are useful when working with directories from the Unix shell (which is usually the most efficient mode of operation):
pwd
cd
directory
mkdir
directory
rmdir
directory
rm -r
instead, but make sure you know what you
are deleting!
The directory argument is usually the name of a directory, but can also be one of the following abbreviations:
~
~xy
xy
.
.
..
ls
.
(``dotfiles'') will not be listed.
ls -a
ls -l
The long list gives file permissions (see below), number of hardlinks, owner, group, file size, modification time, and file name. The information about file permissions is very important. The format is
A dash indicates that a permission is not set. The first column entry can be one of the following:
-
d
l
c
The file permissions can be changed with chmod
, for
example chmod u+x
filename sets the execute
permission for the user (i.e., for you), or chmod o-r
filename revokes the read permission for other users not part
of the ``group'' (for all practical purposes you should treat
``other'' and ``group'' alike). Directories must be executable!
mv
source target
rm
rm -r
. If you don't want to be prompted for every file,
use rm -f
or rm -rf
respectively.
cp
mv
.
tcsh
and bash
only) by pressing
TAB
.
*
matches 0 or more characters,
?
matches 1 character, [abc]
matches a single a, b, or c.
tar
and gzip
commands.
.tar
file which contains all the files
of directory
:
tar -cvpf directory.tar directory
directory.tar
created before),
the resulting file will be named filename.gz
:
gzip -v filename
.gz
compressed file:
gzip -dv filename.gz
.tar
archive file:
tar -xvpf directory.tar
man
command
apropos
keyword
> <
|
grep
Examples:
grep alias .cshrc
.cshrc
ls -l | grep dr
grep John *
ps -ef | sort
Last modified: 1998/02/20