1、Linux(Unix-like) programming environment,teacher:郑琪 Mail: ,Objectives,Be familiar with the commands of linux Be familiar with shell programming Show c programming tools and environment configuration of linux Write basic program on linux Consolidate the comprehension of OS,reference,鸟哥的Linux私房菜,鸟哥编著,
2、人民邮电出版社 Unix编程环境,Brian W. Kernighan著,机械工业出版社 LINUX系统管理技术手册,Evi Nemeth etc.著,人民邮电出版社 Beginning Linux Programming,Neil Matthew etc著,Wiley Publishing, Inc. http:/linux.vbird.org/ http:/ http:/ http:/,Where To Practice,Linux Server(Redhat AS) 192.168.233.7 IBM AIX 192.168.233.244 Local Multi OS Vmware L
3、ive CD Cygwin,About the exam,Test on the machine, do some jobs according to the paper Final score Attendance+Homework 30% Final exam 70%,Lecture 1 Linux Introduction,History of Unix,Unix is not so much an operation system as an oral history genesis:1969-1971 exodus:1971-1980 TCP/IP and the Unix Wars
4、:1980-1990 Blows against the Empire:1991-1995,History of Linux,Minix is developed on x86 for education:1984 Andrew Tanenbaum GNU & FSF:1984 Richard M Stallman Linux kernel distribution: 1991 Linus Torvalds Linux developping community:1991-,Linus Start,From: torvaldsklaava.Helsinki.FI(Linus B. Torval
5、ds) Newsgroups: comp.os.minix Subject: What would you like to see most in minix? Summary: small poll for my new operating system Message-ID: Date: 25 Aug 91 20:57:08 GMT Organization: University of Helsinki Hello everybody out there using minix - Im doing a (free) operating system (just a hobby, won
6、t be big and professional like gnu) for 386(486) AT clones. This has been brewing since april, and is starting to get ready. Id like any feedback on things people like/dislike in minix, as my OS resembles it somewhat (same physical layout of the file-system (due to practical reasons) among other thi
7、ngs). Linus (torvaldskruuna.helsinki.fi),Whos Who,Brian Kernighan,Dennis Ritchie,Bill Joy,Ken Thompson,Linus Torvalds,Richard Stallman,Ken (seated) and Dennis (standing) at a PDP-11 in 1972,Free Software & Open source,GPL(GNU Public License) access source code copy modify redistribute BSD(Berkeley S
8、oftware Distribution) Freeware & Shareware,Variations in Unix and Linux,Unix family: Sco Unix, Solaris, IBM AIX, HP Unix Linux distribution: Redhat, Slackware, Debian, Mandrake, Suse, Redflag, Gentoo, Bluepoint,Ubuntu,Centos, Knoppix POSIX:Portable Operation System Interface,Linux Kernel version,Ker
9、enl kernel maintained by Linus http:/www.kernel.org developping version3.1-rc4 stable version 3.0.3,Linux Certificate,RedHat RHCE http:/ Level one/two/three http:/www.lpi.org,UNIX Software Architecture,Unix devices,Hard Disk,Linux Disk partition,/dev/sda5,file denotes device,Hard Disk,Linux disk par
10、tition load,1,2,3,hda,/,/bin,/boot,/usr,/usr/bin,/boot/grub,File System Mount,partitions are mapped to directories. convention /, swap, /boot,Linux Install,local install CDROM install Hard Disk install network install NFS install FTP install HTTP install,Linux Install,Select proper Linux distributio
11、n plan disk layout install boot loader(grub) select packages,Linux Boot Step,MBR,/boot/vmlinuz,/etc/rc.d,/etc/inittab,/etc/passwd,Linux Boot Step,Inittab: Run Level 3:text interface 5:graphic interface In rcx.d directory Initial S stands for start Initial K stands for kill rc.local for users auto st
12、artup command,Logging On and Logging Off,ways of connection and logging on terminal telnet client User authorization /etc/passwd, /etc/shadow Change password:passwd Logging off Exit or Ctrl-d Reboot & Power Off reboot shutdown, poweroff, halt,Command Interpreter-shell,Various Unix Shells:bash, csh,
13、sh, ksh Choose shell Set in the file /etc/passwd Change default shell:chsh Change current shell Bash startup file /etc/profile: system environment $HOME/. bash_profile: execute once when logging on $HOME/.bashrc: execute each time fork a shell,Environment variables,View environment variables echo:vi
14、ew a single environment variables env, set: view all environment variables Common environment variables $PATH:command searching path $HOME:user logging on directory $PS1:command prompt $LANG: language,Set Environment variables,Set Environment variables Use shell startup file Command line,Linux shell
15、 command prompt,h first part of machine s shell name(ie. “bash”) u user name w current work directory(ie “/home/s1”) $ if not super user (root):“$“;if supper user:“#“,Unix command,Command structure command -option(s)option argument(s) command argument(s) Input several command in one command line,sep
16、arated by ;& | Command auto complement:TAB,Unix command,alias: create pseudonyms (nicknames) for commands Create aliasalias name=string Disable alias unalias nameCommand execute order alias Build-in command Execute file,Shell Metacharaters,view system information,whoami:user identity hostname:host n
17、ame uname:OS information date:system date,Obtaining Help,On line help man section command-list Sections of the UNIX Manual User commands Systems calls Language library calls Devices and network interfaces File formats Games and demonstrations Environments, tables, and macros for troff System maintenance-related commands,Obtaining Help,info pages info command A short description of command whatis command-list,