欢迎来到三一办公! | 帮助中心 三一办公31ppt.com(应用文档模板下载平台)
三一办公
全部分类
  • 办公文档>
  • PPT模板>
  • 建筑/施工/环境>
  • 毕业设计>
  • 工程图纸>
  • 教育教学>
  • 素材源码>
  • 生活休闲>
  • 临时分类>
  • ImageVerifierCode 换一换
    首页 三一办公 > 资源分类 > PPT文档下载  

    Linux用户基础.ppt

    • 资源ID:5438081       资源大小:1.89MB        全文页数:101页
    • 资源格式: PPT        下载积分:15金币
    快捷下载 游客一键下载
    会员登录下载
    三方登录下载: 微信开放平台登录 QQ登录  
    下载资源需要15金币
    邮箱/手机:
    温馨提示:
    用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)
    支付方式: 支付宝    微信支付   
    验证码:   换一换

    加入VIP免费专享
     
    账号:
    密码:
    验证码:   换一换
      忘记密码?
        
    友情提示
    2、PDF文件下载后,可能会被浏览器默认打开,此种情况可以点击浏览器菜单,保存网页到桌面,就可以正常下载了。
    3、本站不支持迅雷下载,请使用电脑自带的IE浏览器,或者360浏览器、谷歌浏览器下载即可。
    4、本站资源下载后的文档和图纸-无水印,预览文档经过压缩,下载后原文更清晰。
    5、试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。

    Linux用户基础.ppt

    Linux内核分析与应用进阶,2007,7,Linux!,Linux是通过网络合作写成的一个Free/Open的操作系统内核。它采用单一内核(monolithic)结构,而支持内核模块运行时动态加载(Loadable Kernel Module)。广义的Linux是指结合了大量的GNU应用软件的发行版本,著名的有Redhat、Debian、Mandrake等。Linux系统在服务器、安全、专用及嵌入式系统等领域有应用潜力。Linux是一个实际的系统,是一个优秀的学习对象。对于深入了解操作系统的原理,探索系统软件的开发方式都很有好处。Linux是一个软件系统模式,是一种精神,一种信念。,ToC,1 Linux is a UNIX clone2 GNU/GPL许可3 Linux目录结构4 GNU/Linux 软件包5 Linux发行版6 Linux试用7 Linux管理 8 Programming in Linux,【1】Linux is a Unix clone,Windows UNIXAT&T-Novell-SCOBSDFreeBSD、NetBSD、OpenBSDMacintosh OSOS目录http:/tunes.org/Review/OSes.html,UNIXs,IBM AIXSGI IrixCompaq Tru64 UnixHP-UXSCO UnixWare/OpenServerSun Solaris关于差异和IEEE/POSIXBSD:FreeBSD,OpenBSDMINIX、Nachos,UNIXs Tree,Solaris 9,The Single UNIX,The Single UNIX Specification,Version 3Base Definitions-a list of definitions and conventions used in the specifications and a list of C header filesShell and Utilities System Interfaces-a list of available C system calls which must be providedRationale-the explanation behind the standard.IEEE/ISO POSIX-Portable Operating System Interface for uniXbased on the BSD and System V releasesnon-Unix systems such as Microsofts Windows NT are POSIX compliantPOSIX thread,Linux功能,兼容unix多用户环境多进程、SMP进程调度进程间通信IPC、Pipe、Socket网络支持TCP/IPv4/IPv6,各种硬件平台支持CPUs存储管理内存管理磁盘交换空间高速缓存动态和共享库(.so)文件系统ext2、ext3、FAT、NTFS、ISO9660,Linux特色,特色Open开发工作活跃可靠性性能移植性好性价比,硬件要求低可为我所用,前景和趋势服务器领域桌面嵌入式商业化cn,Linux Kernel,内核源代码(2.6.21.5)bz2压缩有40M,展开有200多M计21k多个文件,编译后可压缩为约几M的核心(vmlinuz),及几十M的驱动文件。在开机启动运行后,内核提供了300多个系统调用,这是内核和用户进程交互的接口。内核管理CPU、存储器、外设及进程调度等。内核功能可以在运行过程中以内核模块(kernel module)的方式得以扩充。,Linux当前状态,GNU/Linux DistributionFedora 7,Redhat Enterprise Linux 5Debian 3.1/4.0,Ubuntu 7.04Office Suite:staroffice/openofficeWeb/Application ServerDevelopGame,Linux应用现状,应用网络服务器(Netcraft)集群和分布式(Top500和Beowulf/Networx)嵌入式/设备驱动安全领域进一步个人桌面应用服务和支持付费/盈利方式教学与科研,Linux in Top500,Top500 Linux Networx Beowulf based on Linuxbuilt on commodity hardware deploying Linux OS and open source software Self-made,【2】GNU/GPL:Free/Open,The GNU Project Open Sources Richard Stallman Eric RaymondLinux,gcc,Emacs GPL:GNU General Public LicenseGPL v3 其他LicenseBSD Apache Mozilla,许可比较,MS,GPL,BSD,ApacheFollowing Wheeler 2001,free licenses:15185987(50.36%)GPL 2498084(8.28%)MIT 2305001(7.64%)LGPL 2065224(6.85%)MPL 1315348(4.36%)BSD 907867(3.01%)BSD-like 455980(1.51%)GPL,LGPL 323730(1.07%)GPL/MIT 321123(1.07%)Artistic or GPL比较GNU保护用户的利益,要求GNU被作为商业软件时必须附带源代码BSD许可更宽松,允许商业随便使用于商业软件相比,自由软件不提供功能承诺和服务支持Free和Open之别,GNU及其他,The GNU ProjectGNU:GNUs Not Unix!Richard Stallman GPL,gcc,emacs,Free Software,开源运动,Eric RaymondCathedral vs.Bazaarhttp:/catb.org/esr/http:/catb.org/esr/writings/http:/catb.org/esr/faqs/http:/catb.org/esr/jargon/OpenSource vs.Free Software,业余 vs.专业,Open/Free软件的开发人员多数是世界各地的志愿者开发的,如操作系统,编译器,编辑器,Web Server等。这些软件不需要非计算机领域的知识,并且它们的用户多是有熟练计算机知识的人。而专业软件,如CAD、IC设计、企业管理等软件则不是志愿者能够完成的。,版权保护 还是开放,计算机软件保护条例2002年1月1日版,第17、24条关于FreeSoftware和OpenSource学习并利用前面提到的资料和参考网址,写一个关于GNU/Open/Free的报告和总结,并阐述自己的看法M$怎么想?,【3】Linux运行时目录结构,以Redhat/Fedora系列为例/binlinux常用的命令,如cp,ls,ping,mount,vi,tar,kill,grep,rpm,dd,ps,ln,gzip,cat等/boot启动文件,如vmlinuz/dev设备文件,如fd0,hda,hda1,hdb,sda,sda1,cdrom(hdc),mouse(psaux),等/etc配置文件,如hosts,lilo.conf,inittab,rc.d(dir),rc.d/rc0-6.d,samba/smb.conf等,/home,/root每个用户在home下有一个自己的目录。root的在/root权限和保护/lost+foundLost?found!/lib共享库相关文件.so/lib/modules/build/include/mntmount文件系统到这个目录如cdrom,floppy,/var执行中记录数据/proc内存文件,报告程序执行的在线动态信息如进程id数字目录,sys,net等/sbin启动时需要和系统管理员程序工具、配置等如fsck,lilo,init,fdisk等/tmp临时文件夹/usr用户应用程序和文件./X11R6 http:/,Basic Component/in GNU,KernelLinux kernel,Hurd,initShellbashEditorvi,ed,emacsCompilergccApps,【4】Packages(in Redhat 8/9),(适用于Redhat/Fedora系列发行版)rpmrpm-qawhereis lsrpm-qf/bin/lsrpm-ql coreutils,bashGNU Bourne-Again Shell 内置命令cd、exec、exit、export、pwd、echo、set重定向(redirection)stdout2 stderr管道a|b a的输出做为b的输入,fileutilslscpdd:dd if=/dev/fd0 of=bflp bs=1440 count=1ln:ln mkdirmvrmchmod:rwxchgrpchown,procpspsreport process statusw who is on and what doingsysctl configure kernel parameters at runtimetop display top CPU processesuptime Tell how long the system has been runningpstree/in psmisciputilspingping6traceroute(tracepath),textutilscat concatenate sorthead tailmd5sumsplitsplit a file into pieceswc print the number of bytes,words,and lines in filessh-utilsdatesleepsuwhouname print system information,util-linuxkillmoremkfsmake a linux file systemmkswapset up a linux swap areafdiskwhereisdmesg print or control the kernel ring buffer,coreutilssupwdunamemd5sumwhoduprintf,e2fsprogsfsck,mke2fs例子:内存虚拟盘mkdir/mnt/ramdiskmke2fs/dev/ramdiskmount/dev/ramdisk/mnt/ramdisk例子:文件里的虚拟盘(loopback)dd if=/dev/zero of=myd bs=1k count=1024losetup-e des|-e xor/dev/loop0 mydmke2fs/dev/loop0mount/dev/loop0/mnt/mydumount/mnt/mydlosetup-d/dev/loop0(detach),net-toolsifconfignetstatroutearphostnameSysVinitinitprocess control initializationrebootpoweroffhaltshutdown,Binutilsasassemblerararchivesobjdumpdisplay information from object filesldthe GNU linker,Othersmailftptelnetssh/puttyssh-l login_name hostname|userhostname commandrpmrpm-qf/bin/ls 或 rpm-qarpm-q fileutils 或 rpm-ql fileutilsrpm-i installrpm-U upgraderpm-e erase-v verbose-h hash,cvs Concurrent Versions Systemvigcc/g+gdbnasmgrepps-A|grep-v initgziptar cfz/zxf,mountmount-fnrsvw-t vfstype-o options device dirumountless/morefindfind.-name xxx.doc-printfingeruser information lookup programgpg pgpmanwhatis,samba/etc/samba/smb.conf/etc/samba/smbuserssmbapsswd-a启用smb服务samba start 或 smbd;nmbd 或 用setup或service smb startsmbclient-L xxx.xxx.xxx 列目录smbmount windows中映射即可,genpath=/writable=yes,xinetd the extended Internet services daemon/etc/xinetd.conf/etc/xinetd.dtalkftpdisable yesnotelnetfinger在redhat中把ftp后来换成了vsftpd,【5】Linux Distribution,发行版的共同基本组成Kernellinux vs,hurdGNU packagesbash,gcc,vi,emacs,gnome,gimp Open/Free softwareapache、openssl、perl,KDE(koffice),PostgreSQL,BIND,SendMail,其他软件对标准组件的定制:优点与缺点,不同发行版的区别Kernel版本不同的侧重服务器、桌面或综合不同的发行版,不同的安装模式商业、自由redhat,debian本国语言、本地/国际裁剪、加强实时的、嵌入的,Linux发行版举例,Fedora/RedhatDebian/UbuntuGentoo OpenSUSE Mandriva KNOPPIXSlackware http:/,Redhat 9,Fedora core 1,Fedora core 3,Fedora 7,Redhat AS 4,Redhat AS 5,Debian安装,Debian?r?安装源 3.1r6a/4.0http:/CD/http-ftp/最小安装debian-?r?-i386-netinst.iso从U盘安装也是可以的组件安装工具#apt-get/aptitude install?安装中文环境#apt-get install zhcon,knoppix,中文linux发行版,北京中科红旗Linux 国际化i18nl10nlocalization(本地化)unicode,Redflag4,Redflag work station 5,coCreate,Tiny Linux,小Linux在12张软盘上Tomsrtbt TINY Linux embed Linux在DOM(Disk On Module)电子盘容量限制、可靠性、读写次数Linux裁减裁减内核裁剪文件系统,Linux From Scratch,LFSLinux From Scratch(LFS)is a project that provides you with the steps necessary to build your own custom Linux system.Gentoo,Linux Standard Base,LSB 标准和流派,【6】Linux试用,了解不同的发行版取得安装介质决定安装方式选择安装组件登录方式网络设置,了解发行版,上网查询了解Linux的基础知识了解不同的Linux发行版之差别和擅长选择合适的发行版,并注意其最新版本推荐Fedora 7 Debian 3.1/4 中文版 红旗Linux WS5,安装方式,分区磁盘空间全装约6G(Fedora 7)刻盘安装从硬盘上的iso文件安装在虚拟机中安装VMwarehttp:/download/Linux Run-ready in VMware,选择Package,建议kernel开发得安装X可以不安装关于完全安装必须安装内核源代码GCC等开发和编译环境网络工具,登录和共用,SSH Server:OpenSSH by OpenBSD SSH Client:puTTYSecure Shell Clientssh in cygwinUnix体验中心,Remote X,Remote desktop connection“远程桌面连接”rdesktop Xserver for WIN32xmanager演示,文件和数据交换,FTP在Linux上开FTP服务#service vsftpd start在Windows上开FTP服务通过第三方FTP站点交换文件从Linux访问Windows分区mount/dev/hdax/mnt/hdaxSamba in Linuxman samba在linux中用samba访问windows的共享目录在Window中映射虚拟驱动器,【7】Linux管理,Shell磁盘操作服务相关,Shell目录,ShellBASHShell ProgramShell implement,Shell,OS kernelShellApp programscommand cmd explorer/desktop*sh*KDE Gnome,sh,shkshcshbshbashzsh,/bin/sh/bin/bash/sbin/nologin/bin/bash2/bin/ash/bin/bsh/bin/tcsh/bin/csh/bin/ksh/bin/zsh,/etc/shells:,bash,home RPMrpm-ql bash“Linux&UnixShell 编程指南”.boook,Bash Programming,例子/etc/rc.d/init.d/cat tree-a.txt|grep 011|sort cat tree-a.txt|wc*cygwin,Linux中的磁盘,/dev/hda,/dev/hdb/dev/hda1,/dev/hda2,/dev/sda,/dev/sdb/dev/sda1,/dev/sda2,fdiskmke2fs,mkreiserfs,mkswap,swapone2label,Linux中的服务,xinetdrshrexecssh,init,/etc/inittab/etc/rc.d/etc/rc.d/init.d=?=/etc/init.d/etc/rc.d/rc06.d,login,/etc/passwd/etc/shadowlogoutreboot CTL+ALT+DELpoweroffuser management,service,SERVICEDIR=/etc/init.d/etc/init.d/smb#service smb restart,xinetd,*the extended Internet services daemon/etc/xinetd.confincludedir/etc/xinetd.d/etc/xinetd.d/telnet/etc/rc.d/init.d/telnett start|stop|status/etc/services,xinetd.conf,属性适用范围socket_type 所有服务userNon_internal service only 非内部服务serverNon_internal service only 非内部服务wait所有服务protocol不在/etc/services中的所有RPC服务和所有其他服务rpc_vision所有RPC服务rpc_number不列在/etc/rpc中的任何RPC服务port不在/etc/services中的非RPC服务,rsh,port 514/etc/xinetd.d/rshpvm&rshrsh in windows,【8】Programming in Linux,libcforkopen/read/write/closeprintf,Windows中的进程,进程对象session、job、process、thread、fiber进程包含一个自然的主线程,但可以通过beginthread创建新的thread优先级空闲、低于正常、正常、高于正常、高、实时(最高和关键)但是内部优先级分031递增,比如1,6,7,8,9,(10,15)线程调度使用starvation机制,即只在没有高优先级进程等待运行时才给低的机会,fork(),fork()wait()signal(),about fork(),fork1.c:#include main()fork();/1分为2fork();/2分为4puts(“hi”);/给点提示 output:hi hi hi hi编译和运行#gcc fork1.c-o fork1#./fork1,about fork():parent/child,#include int i=5;main()i=6;if(fork()=0)/在子进程 printf(“in child%d i=%d”,getpid(),i);sleep(2);/等会 else/在父进程 printf(“in parent%d i=%d”,getpid(),i);wait(0);/等儿子退出 printf(“end.n”);,output:in parent 1503 i=6in child 1504 i=6end.,signal,#include#include#include void handler(int i)/给点提示puts(in handler,I will exit);exit(1);,输出:in handler,-,main()pid_t pid=fork();if(pid!=0)/在父进程sleep(1);/等儿子准备好kill(pid,SIGUSR1);/给儿子发个信号wait(0);/等儿子退出puts(“bye”);/else/在儿子的地盘/当收到信号SIGUSR1时,执行handlersignal(SIGUSR1,handler);sleep(100);/等死,其实等不了100秒return 0;,Threads,Thread一个进程上可以同时有多个线程共享地址空间,方便通信切换迅速,支持多CPUSolaris的处理把线程在用户空间实现,内核感觉不到线程某用户的线程们被局限在某单一处理器上Linux的线程实现内核能区分和调度不同的线程,Thread编程例子,在windows中beginthread()/CreateThread()在linux/unix中pthread_create()/请看#man pthread_createpthread link option:-lpthreadfork(),Threads in WIN32,#include#include#include void worker(void*p)while(1)puts(char*)p);return;main()_beginthread(worker,0,(void*)A);_beginthread(worker,0,(void*)B);Sleep(1*1000);puts(ok);return 0;,thread,作业1.写一个例子程序演示使用pthread_create等线程函数用法。2.比较其和fork()的区别。*#man pthread_create,多进程编程,Linux守护进程的编程方法,fork()变为后台setsid()变为sessionleader fork()禁止重新打开终端close()关闭文件chdir()改变当前目录inetd相关,Automake,diff,patch,rcs,cvs,rpm,阅读,生成简练的执行文件,阅读in WINsin Linux,Socket Programming,例子 移植,links,Google(”*”)*any subject/key word you likeGNULinuxKernelFreeBSDApache,Linux Movie,The Code Revolution OS,说明,本文中使用的源代码及其文档及试验环境 Fedora 7,Q&A,休息时间到!Lin Fengbo,

    注意事项

    本文(Linux用户基础.ppt)为本站会员(牧羊曲112)主动上传,三一办公仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知三一办公(点击联系客服),我们立即给予删除!

    温馨提示:如果因为网速或其他原因下载失败请重新下载,重复下载不扣分。




    备案号:宁ICP备20000045号-2

    经营许可证:宁B2-20210002

    宁公网安备 64010402000987号

    三一办公
    收起
    展开