Dave’s Highly Abbreviated UNIX Guide

By Dave

 

Controlling and organizing your Gateway Account is done through the use of UNIX command windows. A UNIX command window can be opened by going to the Toolchest on your main screen and selecting ShellsàWinterm. The UNIX command window will then appear on your screen.

 

A command prompt will be the last thing at the bottom of your UNIX command window and will look something like this:

 

[your_gateway_ID][Scientist_name/usr/some_other_name/your_gateway_ID]>

 

This long line is called a “PATH”. A path can be thought of as an address to where on the computer system you are working on. In the first set of brackets, your gateway ID should be displayed. All this means is that you are the user that is logged onto this computer terminal.

 

In the second set of brackets, is the actual address. The first part of the address lets you know what terminal you are working on (they’re also listed on the top of your monitor) and going along with the address idea, this beginning part can be thought of as what country your in. The next part of the path, which can be thought of as your state, is your group. In your case, your account is stored in the group ”usr”. After that is the part of the group your account exists in (the county address). Then finally there is your own account ID, which is similar to a town address.

 

Essentially what is happening here is the computer is accessing a directory or “folder” called “usr”. Inside that directory there is another directory called “some_other_name”. And inside “some_other_name” there is a directory that we have created for you and we have given it the same name as “your_gateway_ID”.

 

You cannot explore what is else is inside “some_other_name” but you can explore and manipulate what is inside the directory “your_gateway_ID”. The directory “your_gateway_ID” can be thought of as your home directory or what is sometimes called your absolute directory.

 

Inside your home directory you will notice there are already some directories created for you. These are important. Do not remove them. The most important one that should already be there is a directory called “public_html”. This is the directory that you will put all of your completed homework in. This is a very special directory in that everything you place in this directory can be seen or obtained via the World Wide Web. This is the only directory set up for you to do this. All other directories are for your private use and only yourself and the lab administrators have access to it.

 

On the next page you will find a list of commands that you can type into your UNIX command window. These commands will help you to organize the files in your account and make better use of the Gateway Lab.


 

ACTION

COMMAND

DESCRIPTION

Make a directory

mkdir directory_name

This will create a new directory or “folder” in the directory you are currently in called “directory_name”

Change the Directory you are working in.

cd directory_name

Move from the directory you are in to a directory inside your current directory.

cd ..

Move from directory you are in to the directory above your current directory.

cd ~

Move to your home or “absolute” directory

View a Directory’s Contents

ls

Displays a list of all of the files and directories within your current directory

ls –la

Displays a list of all of the files and directories within your current directory plus additional information about the size of your file, the last time it was modified and the permissions on that file.

Move a file

mv file_name_to_move directory_to_move_file_into

Move the location of a file from one directory into another directory

Copy a file

cp file_name_to_copy directory_to_copy_file_into

Create a copy of a file in one directory and place that copy into another directory

Delete a file

rm file_name_to_delete

Permanently removes a file from your directory

rm *.*

Permanently removes all of the files in your current directory

rm *.suffix

Permanently removes all files in your current directory with the same suffix, i.e. all files of the same file type

Delete directory

rmdir directory_name_to _delete

Permanently removes a directory from your current directory

Change your Password

yppasswd

Follow the prompts that appear to replace your old or default password with a new one.

Correct Permission Trouble

chmod 755 –R *

This command should ONLY be entered when you are in your “public_html” directory and ONLY needs to be entered when something in your “public_html” directory is accessible at all on the World Wide Web. This command makes all files in that directory visible to the World Wide Web.

 

 

 

PLEASE NOTE: When entering a file name into a UNIX command you must include that file name’s suffix, i.e. to delete a file called “somename.fil” you must type in at the UNIX command prompt:

 

rm somename.fil

 

And then hit enter.