Unix commands are intentionally short, often only two or three characters in length, in order to minimize typing.
The general format for a Unix command is:
cmd -options other arguments
where "cmd" is the name of some command followed by a number of options or other arguments.
Options are generally single characters that represent specific options. The minus sign "-" should be entered before an option. Observe the format of the option in the "man" command in the following table.
Unix is case-sensitive, so be sure you enter the options and arguments in the proper case. Generally lower case is used for commands.
So what happens if you accidentally delete one of these files?
Well, you might find the system acting strangely. For example:
/usr/local/etc/FixDots |
A few commands you should become familiar with:
cd path |
change directory. |
cp path1 path2 |
Copy file(s). |
chmod permissions path |
change the mode, the permissions, on a file or directory.
|
ftp |
call up the "ftp" (file transfer protocol) program. |
ls |
to get a listing of files in a directory |
man command |
to get a Unix Manual entry for a command. |
man -k topic |
use the -k option to find all the entries for a specific topic. |
mkdir path |
make a directory |
more file |
more prints file to the screen and pauses the output when the screen is full. You can view the next screenful or just the next line. Look for the instructions at the bottom of the screen. Enter q to exit more. For help type h |
command | more | When the command is executed | passes its output to more which pauses the output when the screen is full. You can now treat the output like a file as above. |
mv path1 path2 |
move file(s). The original file is deleted. |
passwd |
change your Unix password. |
pine |
call up the "pine" mail utility. |
pwd |
print working directory, i.e. show current path. |
rm path |
to delete (remove) a file |
rmdir path |
to delete (remove) a directory. |
script file_name |
cause everything that appears on the screen to be placed in the file_name. |
TeraPrint file_name |
Send the file to whatever printer is designated as your default Windows printer. |
The following illustration explains how to use several of these Unix commands to create a "Home Page" that can be viewed as an Internet World Wide Web file.
cd |
Ensure that you are in your home directory. |
chmod 711 ~/ |
Change the mode of your home directory to make it world readable. |
mkdir public_html |
Make a directory called "public_html"; notice the underscore character. |
chmod 711 public_html |
Make public_html world executable. |
cd public_html |
Change your location to the public_html directory you just created. |
pwd |
Print the current working directory just to make sure you are where you want to be. |
Use an editor to create a file called index.html or copy a sample file from another location. |
|
ls -l |
Get a long listing of your current files. If you had used vi to create the file, you will see something like this: |
chmod 644 index.html |
Change the file mode so that others can read the file. |
ls -l |
Get a long listing to make sure the file permissions are set properly. |
For more information on these, and other Unix commands, refer to the 4.6 UNIX System section of the CS Dept Users Manual.
For information on the vi editor, refer to the 5.2. VI EDITOR section of the CS Dept Users Manual.
The Users Manual can also be accessed from the CS Dept Home page, following the links: General Info - Lab Manuals.
Copyright: Department of Computer Science, University of Regina.