Lab Compiling Under Linux
Lab Compiling Under Linux
Computing-I
1
Objectives for the Lab
2
Agenda
Environment setup
Login to Pegasus
Email
Introduction to UNIX
UNIX files and directory structure
Basic UNIX commands
3
Agenda
4
Login to UNIX
User Name
Oncourse username
Password
Oncourse password
5
Login (Cont’d)
UNIX is case-sensitive!
The username and the password are in lower-case
If you are NOT able to logon then:
Contact a Lab Instructor or Course Instructor
Once you login for the first time, the system will
prompt you to change the password…create a new
password and remember it
6
Introduction to UNIX
7
The UNIX Directory Structure
A directory is a location to store
information.
login: jsmith
Password:
Last login: Mon Aug 22 08:42:33 from gatekeep.usagrou
Sun Microsystems Inc. SunOS 5.8 Generic February 2000
pegasus{jsmith}1:
Command
Command
number
number
Machine
Machinename
name
User
Username
name
9
Essential UNIX Commands
ls- list files in present working directory
pwd- display present working directory
cd- change directory
cd .. Backup one directory level
lp (or lpr) - print file to printer: Printer in SL251!
rm- remove a file
cp- copy a file
mv- move or rename a file
mkdir- make a directory
rmdir- remove a directory
10
Email
11
Class E-mail Subscription
pegasus{jsmith}1:emacs filename
14
How to Compile A Program
15
How to Execute Your Program
pegasus{jsmith}1: a.out
Type the name of the executable file at the
prompt to run your program
16
Your First C Program
# include <stdio.h>
main(void)
{
printf(“Hello, CSCI 230!\n”);
}
Try it!
17