Linux运维历史和计算机基础:     

           

        计算机的五大部件;运算中的二进制

                        CPU:运算器,控制器

                        内存:存储器

                        IO:输入设备和输出设备

 

                        寄存器

                        内存:编址

                                    cell8bits, 1bytes

                                                地址表示

                                    32bits,64bits

                                                2^32=4*2^10*2^10*2^10=4G

                        CPU:

                                    功能:

                                                针脚

                        程序员:程序

                                    程序=指令+数据

            OS的通用性:

                        进程管理、内存管理、驱动程序、网络协议栈、安全功能

            Linux:

                        Unix-like

                                    Unix元年:197011

                                    Bell,AT&T

                                                SystemV:嫡出

                                                Berkeley:BSRG, BSD:庶出

 

                                                System

 

                                                GNU:GNU is Not Unix

                                                            GPL:General Public License

                                                《硅谷传奇》

 

                                    Andrew:Minix

                                                Linus,--> Linux

                                                GPL

 

                                    GNU/Linux

                                    https://www.kernel.org/

 

                        Linux主流发行版:

                                    Debian

                                                ubuntu

                                                knoppix

                                    Slackware

                                                S.u.S.E

                                    Redhat

                                                RHEL:RedHat Enterprese Linux

                                                            CentOS:Community ENTerprise Operation System

                                                redhat--> Fedora: 6个月

 

                                    Gentoo

 

                                    ArchLinux

 

                                    LFS

 

            CentOS:

                        6.x: 6.7

                        7.x: 7.1

 

 

 

我们可以在虚拟化环境下实现:

            vmware workstation:            vmware12

            virtualbox

                        SUN --> Oracle

                        version: 5

 

            作业:安装CentOS 6.7 以及 CentOS 7.1

 

问题1CentOSLinux是什么关系?CentOSRHEL是什么关系?

 

GNUGNU is Not Unix.

            GNU: GPL

                        GPL: General PublicLicense

 

            自由软件:

                        自由使用;

                        自由学习和修改;

                        自由分发;

                        自由创建衍生版;

 

            GPL

                        GPLv2, GPLv3,LGPL(lesser)

                                    10000, 10

 

                        ASF: apache license

                        BSD: BSD license

 

            Linux: GPL

                        GNU/Linux

 

            Linux哲学思想:

                        1、一切皆文件:

                        2、由众多目标单一的小程序组成;

                                    一个程序只做一件事儿,并且做好;

                                    组合小程序完成复杂任务;

                        3、尽量避免跟用户交互;

                        4、使用纯文本文件保存配置信息;

 

            用户界面:

                        User Interface: UI

 

                        GUIGraphic UI

                                    GNOME, KDE,XFCE

                        CLI: Command LineInterface

                                    sh(boarn, bsh)

                                    csh

                                    tcsh

                                    ksh

                                    bash(boarn again shell)

                                    zsh

 

                        终端:terminal

                                    物理终端:/dev/console

                                    虚拟终端:/dev/tty#

                                                [1,6]

                                                7

                                                Ctrl+Alt+F#

                                    串行终端:/dev/ttyS#

                                    伪终端:/dev/pts/#

 

                                    tty:显示当前终端设备;

                                    startx&: 启动GNOME界面

 

            命令提示符:prompt

                        #: 管理员,拥有管理权限

                        $: 普通用户,仅能够运行非管理类命令

 

                        [root@localhost ~]PS1环境变量定义的提示格式

 

                        # echo $SHELL:获取当前正在使用的SHELL程序;

 

                        Note: bash程序通过环境变量来保存环境配置信息;

                                    PS1

                                    SHELL

                                    PATH:保存了许多以冒号分隔的路径,由bash在查找命令时使用;

 

            命令:

                        输入命令,回车:

                                    提请bash程序分析给出的命令行信息,找出哪个是命令,并找出命令对应的可执行程序文件,提请给内核启动为一个进程;

 

                                    命令有两类:

                                                内建命令:shell程序自带的命令;

                                                外部命令:每个命令都有一个与之对应的,且名字同命令的可执行程序文件;

 

                                                            type命令:来判定给定的命令是内部命令,还是外部命令;

                                                            查看外部命令对应的可执行文件的位置:

                                                                        which

                                                                        whereis

 

                        运行命令:

                                    命令格式:

                                                COMMAND[OPTION]... [ARGS]...

                                                            选项:用户启用或关闭命令的某个或某些功能;

                                                                        短选项:-CHARACTER

                                                                                    -l,-h

                                                                                Note:多个短选项如果不合并,则彼此间要有空白字符分隔;可合并,合并时使用一个-引导,例如-lh;有些短选项自己也需要带参数,这叫选项参数;

                                                                        长选项:--word

                                                                                    --human-readable,--help

                                                            参数:命令的作用对象;

                                                                        向命令提供数据;

 

            文件系统:

                        数据有两类:

                                    元数据:metadata

                                    数据:data

 

                        文件命名规范:

                                    1、严格区分字符大小写;

                                                niulang,Niulang

                                    2、文件名可使用除/以外的任意字符;不建议使用特殊字符;

                                    3、文件名最长不能超过255个字符;

                                    4、所有以.开头的文件均为隐藏文件;

 

                        根文件系统:

                                    rootfs: rootfilesystem

 

                                    绝对路径:从根开始的路径;

                                    相对路径:从当前位置开始路径;

                                                当前目录:currenctdirectory, working directory

                                                主目录:家目录,HOME

 

                                    /etc/rc.d/rc.sysint

                                                /etc/rc.d/rc.sysinit

                                                /etc

                                                            rc.d/rc.sysint

                                                            ./rc.d/rc.sysint

 

                                                ..:父目录

 

                        LSB: Linux Standard BaseCore Specification

                                    FHS: 文件层级标准

 

                        pwd命令:显示当前目录