2.07k likes | 2.18k Views
Unix/Linux Basic Course. www.itlab.com.cn. Joshua Xu / 许建华 中国上海 : 电 话: 21-62470421,62470432 地 址:上海市南京西路 1468 号 东海电脑广场 3 号楼八层 Email : joshua@itlab.com.cn 新加坡: Tel : (65) 67760365 Address: Blk432, #07-274 Clementi Avenue 3 120432. Joshua Xu
E N D
Unix/Linux Basic Course www.itlab.com.cn Joshua Xu / 许建华 中国上海: 电 话:21-62470421,62470432 地 址:上海市南京西路1468号 东海电脑广场3号楼八层 Email:joshua@itlab.com.cn 新加坡: Tel : (65) 67760365 Address: Blk432, #07-274 Clementi Avenue 3 120432 Joshua Xu 高端软件培训 Joshua@itlab.com.cn CONFIDENTIAL
Objectives(5 days) • Unix/Linux Operating System Background • Unix/Linux Basic commands • File and Directory Manipulation • Editor(vi) • User and Process management • Shell programming • Makefile • Linux Installation and Setup
Unix • History • Other Compatible Unix Systems
Linux • MINIX (PC Unix) 1991 (Andrew S. Tanenbaum) • Linux 0.02 1991 (Linus benedict Torvalds) • Linux 2.x.x POSIX Compliant to current version
Linux VS Unix(1) • Linux is a real Unix, Functionality(Multi User, MultiTask,…) • POSIX compliant(from Ver2.x.x) • System V & BSD compatible
Linux VS Unix(2) • Open Operating System Code System Customizing • Minimum Hardware Requirements • Support Multi File System(minix,ext,fat,…..) • Software Resources and Powerful Functionality • Unix is certified to be the robust system, Linux not yet…
Unix VS Windows(1) • Hardware platform and Location • Reliability or Robustness
Unix VS Windows(2) • User interface: ls option parameters ls ls -al Redirection and pipe grep find • Multi task
Unix VS Windows(3) • Multi users
Unix VS Windows(4) • Security System know who you are File and directory priority
More About Unix/Linux • What can it do? • Production Line: Web Server, Mail server, Database Server • Program Development • Who should know Unix/Linux? • Unix administrator, System Manager, System Consultant • Oracle Administrator, Network Engineer, Program Developer
Linux/Unix two Functions • What are the two functions of OS? How to?
Resource Management(1) • RAM, DISK difference • rams are paged
Resource Management(2) • CPU eg: ticket system
Resource Management(3) • intangible resources’ management opened files sockets Locks
shutdown shutdown -[rhk] <time> warning <time>: hhmm[am|pm] MMDDYYYY + offset MMDDYY JAN 20 2004 NOON MIDNIGHT TEATIME now Offset:n[minute,hour,day,week]
telnet telnet 192.168.100.1 [port] Add item into file: c:/windows/system32/desktop/driver/hosts
login login: ( username) password: (user’s password)
Logout Logout or exit or ^D
Passwd passwd
uname uname -a
Exit Exit or ^D
Telnet What’s the telnet? a program a main function with a window how does it work? a client connected to a telnet server a protocol
ftp ftp program, ftp command, ftp server ftp client, ftp protocol ? --help ls cd bin & asc get & put mget & mput bye
Terminal What’s the terminal? What’s console, terminal, pseudo-terminal tty0 tty1 pts/0 Echo $TERM stty -a /stty all stty erase ^? intr ^C kill ^U eof ^D swtch ^Z quit ^\ ^J stty sane ^J
logname logname
whoami whoami
who • Who • each user has an account, has a password and a home directory
date date date –u date +%Y/%m/%d to set date: date MMDDHHMMCCYY ( this need root priority)
cal cal -y –j month year
clear clear
echo Echo Echo –e abc“\a” -e:enable control char \a alarm \c remove newline \n newline \t tab \\ “\” \b backspace \f new page \r linefeed \v vertical tab \nnn octal digit
write write uid@host Write tty(n) Write ttyp(n)
mesg mesg -n –y :you cann’t mask root’s message mesg joshua
mail mail
man man -n command 1 command 2 syscall 3 lib 4 special file 5 file format info …
su su password: (root’s password)
-------- What’s file? File is the storage of data, program File is the most important data structure of operating system
Path Name • Path name uniquely specify particular file or directory • Path name separated by “/” • A “/” in the first position represents the root directory
ls(1) ls option: -a –A –l –v --help • Note: file name rule no “/” 1 !@#$%&*()[]{}’ ” \ | / ; < > SPACE 2 case sensitive 3 .txt .doc .sh .html .pl .c .o .tar .gz .rmp
File Attribute(2) Type: - d l b c s p to see /dev/hda1 /dev/cdrom …
chmod(2) chmod a-w,o-rx *.cat