1 / 18

Why we choose UNIX

Why we choose UNIX. Powerful Multi-user operating system Good programming tools Most heavy-duty database management systems started out on Unix Flexible   Thousands of tools that can be combined and recombined. Reliable Unix is hard to crash. Your personal computer (client).

jamuna
Download Presentation

Why we choose UNIX

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Why we choose UNIX • Powerful • Multi-user operating system • Good programming tools • Most heavy-duty database management systems started out on Unix • Flexible   • Thousands of tools that can be combined and recombined. • Reliable • Unix is hard to crash.

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

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

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

  5. SSH • Why SSH • Download SSH • http://www.openssh.org/ Figures from http://www.suso.org/docs/shell/ssh.sdf

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

  7. Unix Commands • man – manual (man gcc) • ls – list directory contents (ls) • pwd – prints working directory (pwd) • cd – change directory (cd <subdirectory>) • mkdir – create directory (mkdir <new directory> • rm – remove a file (rm <file to remove>) • Use –r if removing a directory

  8. Unix Commands(cont) • cp–copy a file (cp <source><destination>) • Use –r if copying a directory • mv–move or rename files (mv <source> <destination>) • jpico – text editor (jpico <file to edit>) • gcc – compiler (gcc sourceFile.c) • -o option • Directory shortcuts • ~ home directory • .. parent directory • . sub directory

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

  10. Your First Program Preprocessor: interactwith input/output of your computer #include <stdio.h> int main() { printf("Hello World\n"); return 0; } Start point of the program • 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. Your First Program Preprocessor: interactwith input/output of your computer #include <stdio.h> int main() { printf("Hello World\n"); return 0; } Start point of the program Start and finish of function

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

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

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

  15. Comments for programs • Why need comments • Good habit • Readable to others • Remind yourself • How to comment • /* … */ • // … • Effects on compiler • Examples

  16. Compiler • What is compiler • A 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) • Why we need a compiler • Available C compiler in UNIX system: gcc gcc sourcefile.c –o exefile.exe

  17. Text Editors • Edit your code Using wordpad, or some text editor on your personal computer • Need to transfer your program to UNIX machine using ftp • Edit your code in UNIX using • vi • pico (jpico) • emacs

  18. helloworld.c #include <stdio.h> int main() { printf("Hello World\n"); return 0; } C-compiler helloworld.exe 0011 0000 1010 0110 1100 0110 1011 0101 1010 1110 0110 1110 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 Type gcc helloworld.c –o helloworld.exe to compile helloworld.c into helloworld.exe using the gcc compiler The gcc compiler generates corresponding executable code named helloworld.exe. The computer can execute this machine readable code if you type ./helloworld.exe

More Related