Equivalent to the MS-DOS "type" command. To pause a file
every screen, type
cat file | more.
The command
cd my_dir changes your position to the directory
specified, in this case
my_dir. The command
cd without an
argument moves you to your home directory.
The command
cp first_file copy_file copies the contents of
first_file into the file
copy_file. To indicate that the
new file is to have the same name as
first_file, use a period (.)
instead of of providing a name for the second file. (In
this case, the files must be in separate directories,
as two files cannot have the same name if they are in the same directory.)
For example:
cp some_directory/my_file . copies
my_file, located in
some_directory, and creates a file named
my_file in the current working directory.
The command
grep string filename searches
filename
for
string. It outputs every line which contains
string.
The form
grep -v string filename outputs every line which
does not contain
string. The argument
string is read by
grep as a regular expression.
The command
kill my_process sends a terminate signal to the
process specified by the process id (PID)
my_process. In cases
where the terminate signal does not work, the command
kill -9 my_process sends a kill signal to the process. For info on getting the PID
for a process, see
ps.
The command
ls lists the files in the current directory. The
form
ls -F shows the difference between directories and
ordinary files. The form
ls -a lists all files, even those that
are normally invisible in UNIX (files whose names start with a period,
i.e.
.xstartup).
The command
man command displays the UNIX manual page for
command. The manual pages describe usage and options for every
UNIX command.
The command
mkdir new_dir creates a new subdirectory named
new_dir in the current directory.
The command
more my_file displays the text of
my_file
one page at a time. To see the next page, hit the space bar; to see the previous
page, type
b; to quit paging the file, type
q.
The command
mv file_name dir_name moves the file
file_name
from the current directory into the directory
dir_name, where
dir_name is a subdirectory of the current directory. The form
mv old_file new_file renames
old_file and calls it
new_file.
The command
passwd allows you to change the password you use to
login to the computer. The process is self-explanatory once you type the
command.
The command
ps lists the processes running on your machine. The
form
ps gux lists only your processes. The form
ps aux lists
all processes running on your machine. The second column of the listing,
the PID column, provides the information required by the
kill command.
The command
pwd prints the pathname of the current, or working,
directory.
The command
rm my_file deletes
my_file. The form
rm -i my_file asks if you really want to remove the
file
my_file before it proceeds.
The command
rmdir my_dir removes the directory
my_dir.
The directory must be empty before it can be deleted.
note: If you get an error message that a directory is not empty
when it appears to be, check for invisible files
(see ls).