Rebooting into linux in the labs
All of the pcs in the labs are dual bootable machines. That means that
they can run either the NT operating system or the linux operating system.
When you sit down at the computer it will most likely be running NT.
If you intend to work on your project, you should first reboot the pc into
linux. To do so, follow these instructions:
- Press the Ctl, Alt and Del keys at the same time
- Click Yes on the restricted access warning window
- Click Shutdown
- Wait for a few seconds for the Menu of Operating System Choices
- Highlight Linux and press Enter
If you wait too long to select the linux option, the machine will
automatically reboot itself into NT and you'll have to start over
- Wait for linux to load
This takes a little while and much information will scroll by
You'll end up with a linux login screen
- To login to your account enter your userid and password
- Click on terminal
- A terminal window will open and display a unix prompt
Practicing using UNIX Commands
- When you first login to your account you will be in your home
directory.
- To see the names of the directories and files that are already
in your home directory, type ls
ls stands for list - it lists the items in the current directory.
- You should see mail and possibly some other files and directories.
Directories are like folders in Windows. You should create
directories as needed to keep your files orderly.
- Make a directory called 201 by typing the command mkdir 201
- Now type ls and you'll see the name of the directory that
you just created.
- To change into the 201 directory, type cd 201
- Now type ls Notice that there are no files
in this directory.
- Now make a directory for your project 0 in this 201
directory, by typing mkdir proj0
- Make directories for projects 1 through 5.
- Now go into the proj0 directory by typing cd proj0
- Normally you will make a file by using a text editor, but to make
this a quick exercise, we'll create an empty file (a file that
has a name, but has nothing in it) using the UNIX touch command
- To make an empty file called proj0.c, type touch proj0.c
- Now type ls and see that you have a file in this directory
called proj0.c
- The cp command allows you to make a copy of a file or directory
and give it a different name. Type cp proj0.c copy.c
- Now type ls to see that you have two files now, one called
proj0.c and one called copy.c
- The mv command allows you to move a file and/or change a file's
name. Type mv copy.c same.c
- Now type ls to see that the files are now called proj0.c
and same.c
- The rm command allows us to remove or delete a file. Type
rm same.c You will be prompted to make sure that you really
do want to delete this file. Answer with a lower case y
- Now type ls and notice that the only file in the directory
is proj0.c. same.c no longer exists
- We've used the cd command before to move into subdirectories by
typing cd and the directory name. Using the cd command, without
a directory name following it, will take you to your home directory
Type cd
- Now type ls and you should recognize the files that are in
your home directory.
- The pwd command tells you your current directory. It stands for
"print the working directory" Type pwd and you will see
the full path to your home directory. Mine is
/afs/umbc.edu/users/s/b/sbogar1/home and yours will be similar.
- Now let's change directory into our proj0 directory again by typing
cd 201/proj0
- Type pwd and you will see that the full path is
/afs/umbc.edu/users/ ... /home/201/proj0
- We can also use the cd command to go up one level in the directory
tree. Type cd .. Now type pwd and you'll see that
you have gone up one directory and are now in your 201 directory.
- Once you understand how to move around, you can give more
complicated commands like cp fileheader.c ../proj2/
- Now copy the .emacs file from my cs201 directory into your home
director by following these steps:
- cd (changes you to your home directory)
- pwd (to make sure you are in your home directory)
- cp /afs/umbc.edu/users/s/b/sbogar1/pub/.emacs .
The space and the dot after the fullpathname and filename
means to copy that file into your current directory.
- Files whose names begin with a dot aren't shown to you when
you give the ls command. They are called hidden files and they
are typically files that are accessed by software you are using.
In this case what is in the .emacs file are the settings we want
you to use when using the xemacs editor. These settings will give
you perfect indentation according to the course standards
automatically. To see the hidden files in your home directory,
type ls -a