Presentation is loading. Please wait.

Presentation is loading. Please wait.

CGS 3460 Why we choose UNIX n Powerful lMulti-user operating system lGood programming tools Most heavy-duty database management systems started out on.

Similar presentations


Presentation on theme: "CGS 3460 Why we choose UNIX n Powerful lMulti-user operating system lGood programming tools Most heavy-duty database management systems started out on."— Presentation transcript:

1 CGS 3460 Why we choose UNIX n Powerful lMulti-user operating system lGood programming tools Most heavy-duty database management systems started out on Unix n Flexible lThousands of tools that can be combined and recombined. n Reliable lUnix is hard to crash.

2 CGS 3460 How to Access a UNIX Machine Your personal computer (client) rain.cise.ufl.edu (server) telnet / ftp telnet: allows you to connect to other computers and use softwares there ftp: allows you to retrieve files from other computers.

3 CGS 3460 Telnet n TELetype NETwork lA network protocol used on the Internet / LAN lBy extension, refers to the program which provides the client part of the protocol n Once connected lLog on as a regular user with access to application / software data n A Telnet command request looks like this ltelnet rain.cise.ufl.edu

4 CGS 3460 FTP n File Transfer Protocol lA network protocol used on the Internet / LAN lAllow to transfer files to and from remote computers n A ftp command request looks like this lftp rain.cise.ufl.edu

5 CGS 3460 SSH n Why SSH Figures from http://www.suso.org/docs/shell/ssh.sdf n Download SSH lhttp://www.openssh.org/http://www.openssh.org/

6 CGS 3460 More about SSH n Recommendation for Windows lPutty as telnet tool http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html lWinSCP as ftp tool http://winscp.net/eng/download.php n Other choices lftp, telnet using command line in windows lOther softwares Core FTP http://www.coreftp.com/download.html

7 CGS 3460 Unix Commands n man – manual (man gcc) n ls – list directory contents (ls) n pwd – prints working directory (pwd) n cd – change directory (cd ) n mkdir – create directory (mkdir n rm – remove a file (rm ) lUse –r if removing a directory

8 CGS 3460 Unix Commands(cont) n cp–copy a file (cp ) lUse –r if copying a directory n mv–move or rename files (mv ) n jpico – text editor (jpico ) n gcc – compiler (gcc sourceFile.c) l-o option n Directory shortcuts l~ home directory l.. parent directory l. sub directory

9 CGS 3460 Your First Program #include int main() { printf("Hello World\n"); return 0; } Preprocessor: interact with input/output of your computer You will see this at the beginning of nearly all programs Tells computer to load file named allows standard input/output operations

10 CGS 3460 Your First Program #include int main() { printf("Hello World\n"); return 0; } Start point of the program Preprocessor: interact with input/output of your computer C programs contain one or more functions, exactly one of which must be main int means that the function main will "return" an integer value

11 CGS 3460 Your First Program #include int main() { printf("Hello World\n"); return 0; } Start point of the program Preprocessor: interact with input/output of your computer Start and finish of function

12 CGS 3460 Your First Program #include int main() { printf("Hello World\n"); return 0; } Printing a line of Text Start point of the program Preprocessor: interact with input/output of your computer Start and finish of function

13 CGS 3460 Your First Program #include int main() { printf("Hello World\n"); return 0; } Printing a line of Text Start point of the program Preprocessor: interact with input/output of your computer Start and finish of function New line character

14 CGS 3460 Your First Program #include int main() { printf("Hello World\n"); return 0; } Printing a line of Text Start point of the program Preprocessor: interact with input/output of your computer Start and finish of function Finish and return value 0 A way to exit a function It means that the program terminated normally in this case

15 CGS 3460 Comments for programs n Why need comments lGood habit lReadable to others lRemind yourself n How to comment l/* … */ l// … n Effects on compiler n Examples

16 CGS 3460 Compiler n What is compiler lA computer program (or set of programs) that translates text written in a computer language ( the source code) into another computer language (most time the executable file) n Why we need a compiler n Available C compiler in UNIX system: gcc gcc sourcefile.c –o exefile.exe

17 CGS 3460 Text Editors n Edit your code Using wordpad, or some text editor on your personal computer lNeed to transfer your program to UNIX machine using ftp n Edit your code in UNIX using lvi lpico (jpico) lemacs

18 CGS 3460 Procedure This is your C program. Type the code in any standard text editor, and save it as helloworld.c. Transfer it to rain.cise.ufl.edu if necessary #include int main() { printf("Hello World\n"); return 0; } helloworld.c C-compiler Type gcc helloworld.c –o helloworld.exe to compile helloworld.c into helloworld.exe using the gcc compiler 0011 0000 1010 0110 1100 0110 1011 0101 1010 1110 0110 1110 helloworld.exe The gcc compiler generates corresponding executable code named helloworld.exe. The computer can execute this machine readable code if you type./helloworld.exe


Download ppt "CGS 3460 Why we choose UNIX n Powerful lMulti-user operating system lGood programming tools Most heavy-duty database management systems started out on."

Similar presentations


Ads by Google