复习之前的和补充一些内容

第1章 服务器:

1.1 服务器的组成:

服务器的组成--机架式服务器

dell(戴尔服务器):

1850  1950  r710  r730

服务器尺寸:

-U  1U  2U  4 U 

19英寸

CPU 2个物理cpu

服务器cpu的个数---几路

一般都会说几路cpu

服务器有两个物理cpu------2路

内存 :

1.程序 进程 守护进程

运行起来的程序

ps -ef  

PID process id  进程号码 进程的身份证号码

守护进程-一直运行的进程 sshd

远程连接----sshd软件

第2章 如何提高用户体验

高并发( 抢票  秒杀  )

尽量把数据放到内存中,然后放到磁盘   (memcached / redis)

中小企业

写入---用户把数据放入到磁盘.

读取---从硬盘----内存----用户

第3章 写buffer与读cache

硬盘

硬盘与你的电脑的链接方式-------接口 水壶的壶嘴

SATA   转速 5.4k/分钟  7.2k/分钟  500G

SAS    15k 300G  600G           企业默认的硬盘接口

第4章 linux发展过程

蛋-人-人-人

unix---freeBSD/Debian

       AIX(IBM 必须使用对应的硬件)

      

谭教授--minix

斯托曼--GNU GPL

GNU-gawk,bash gcc emacs

linus torvalds

 linux内核

GNU/linux

第5章 安装最小化安装方法

      Minimal(最小化)

      选择了4个大礼包

      如何查找我要安装什么大礼包(包组):yum grouplist

      yum groupinstall "大礼包的名字"

#tree

yum install tree -y

rpm -qa |grep tree

tree-1.5.3-3.el6.x86_64

rpm -e   ##删除软件

#yum grouplist

#yum groupinstall "Development tools" -y

#yum源-------外面列表---软件列表

#A软件管家

#B软件管家

Loaded plugins: fastestmirror, security

Setting up Group Process

Determining fastest mirrors

 * base: mirrors.aliyun.com

 * extras: mirrors.aliyun.com

 * updates: mirrors.aliyun.com

第6章 远程连接拍错过程---屌丝去洗浴中心之路

1.路是否通畅

ping 10.0.0.200

2.查看是否有人劫财劫色

selinux

iptables

3.查看是否有人提供服务

telnet 10.0.0.200 22 ###服务器的22端口是否开启

ss -lntup ##显示服务器开启了什么端口

[root@oldboyedu-40-nb ~]# ss -lntup

Netid State      Recv-Q Send-Q    Local Address:Port   Peer Address:Port

tcp   LISTEN     0      128                  :::22               :::*      users:(("sshd",1522,4))

tcp   LISTEN     0      128                   *:22                *:*      users:(("sshd",1522,3))

tcp   LISTEN     0      100                 ::1:25               :::*      users:(("master",1601,13))

tcp   LISTEN     0      100           127.0.0.1:25                *:*      users:(("master",1601,12))

ss -lntup|grep 22

查看sshd进程是否存在

ps -ef|grep sshd

排查

1.ip是否正确

ifconfig

2.网卡中-DNS和网关

DEVICE=eth0

TYPE=Ethernet

ONBOOT=yes

NM_CONTROLLED=yes

BOOTPROTO=none

IPADDR=10.0.0.200

NETMASK=255.255.255.0

GATEWAY=10.0.0.2

DNS1=223.5.5.5

DNS2=223.6.6.6

PEERDNS=yes

3.vmware软件问题--windows

1)5服务开启

2)编辑-虚拟网络编辑器

3)打开一个目录----网络连接

find命令补充

find 交给ls rm  sed

第7章 找出/oldboy目录下面 以.sh结尾的文件 然后复制到/tmp下面

7.1 准备环境:

mkdir -p /tmp/dir{a..d}

[root@oldboyedu-40-nb ~]# find /oldboy/ -type f -name "*.sh"

/oldboy/test/del.sh

/oldboy/t.sh

/oldboy/test.sh

7.2 方法1

find /oldboy/ -type f -name "*.sh"|xargs cp /tmp/dira

cp /tmp/dira /oldboy/test/del.sh /oldboy/t.sh /oldboy/test.sh

cp: target `/oldboy/test.sh' is not a directory

cp     /etc/hosts /etc/services /tmp (筐)

cp -t  /tmp(筐)   /etc/hosts /etc/serivices .......

7.3 方法1--最终方法

find /oldboy/ -type f -name "*.sh"|xargs cp -t /tmp/dira

7.4 方法2 $()

cp  find命令找到的文件    /tmp/dirb

cp  $(find /oldboy/ -type f -name "*.sh")    /tmp/dirb

7.5 方法3 -exec

[root@oldboyedu-40-nb ~]# find /oldboy/ -type f -name "*.sh" -exec cp {} /tmp/dirc ;

[root@oldboyedu-40-nb ~]# ls -l /tmp/dirc/

total 12

-rw-r--r-- 1 root root 8 Aug 29 04:46 del.sh

-rw-r--r-- 1 root root 8 Aug 29 04:46 test.sh

-rw-r--r-- 1 root root 8 Aug 29 04:46 t.sh

7.6 方法4 |xargs

[root@oldboyedu-40-nb ~]# find /oldboy/ -type f -name "*.sh" |xargs -i  cp {}  /tmp/dird/

[root@oldboyedu-40-nb ~]# ls -l /tmp/dird

total 12

-rw-r--r-- 1 root root 8 Aug 29 04:54 del.sh

-rw-r--r-- 1 root root 8 Aug 29 04:54 test.sh

-rw-r--r-- 1 root root 8 Aug 29 04:54 t.sh

|xargs -i  让xargs可以使用 {}   {}表示前面命令找到的内容

   sed 's###g' oldboy.txt

   sed 's#/boot#/root#g' oldboy.txt

   sed 's@@@g' oldboy.txt

   sed 's@#@@g' oldboy.txt

sed -i.bak  's#lidao#doc-tan#g' /oldboy/test.sh

##先对文件进行备份 /oldboy/test.sh.bak

##然后对文件的内容进行修改

#环境变量  LANG(/etc/sysconfig/i18n) PATH PS1(/etc/profile)

第8章 如何修改主机名

      查看主机名:hostname 

      临时修改主机名:hostname oldboyedu36

      永久修改主机名:/etc/sysconfig/network

      让主机名能解析 (ping 主机名可以畅通)

            ip地址 主机名 放入到/etc/hosts

第9章 Linux里面必知必会的文件及目录

[root@oldboyedu-40-nb ~]# column -t a.txt

/etc/sysconfig/network-scripts/ifcfg-eth0 

linux第一块网卡的配置文件

/etc/resolv.conf         DNS配置文件

/etc/hosts               ip与主机名解析关系                  主机名解析文件

/etc/fstab               开机自动挂载分区/磁盘               规定哪个分区/设备  挂载到哪里

/etc/profile             系统的环境变量,别名

/etc/bashrc              别名存放位置

/etc/init.d              系统的软件/服务的管理命令           存放在这里

/etc/inittab             运行级别的配置文件

/etc/rc.local            存放开机自启动的程序或命令

/etc/sysconfig/network   永久(重启服务器)修改主机名的地方

/usr/local               编译安装时候默认的安装位置          相当于是windows    c:program                files

/var/log/message         系统普通的日志                      病例               诊断报告

/var/log/secure          用户登录的信息                      什么时候           谁从哪里登录登录是否成功

/proc/mounts             系统挂载信息

/proc/loadavg            系统负载信息

/proc/meminfo            系统内存信息

/proc/cpuinfo            系统cpu信息

如何查询帮助

1. man 命令

2. 命令 --help 

3. help  内置命令

   cd  alias

4. man.linuxde.net

5. vim

  :h[elp]  G

  :h[elp]  gg

  :h[elp]  :wq

  退出帮助

  :q

第10章 linux启动过程

第11章 反引号·单引号·双引号

反引号 ``== $()  先运行里面的命令 把显示在屏幕上面的内容留下

单引号 双引号 不加引号 区别

1.单引号:所见即所得  吃啥吐啥 

[root@oldboyedu-40-nb ~]# echo '$LANG $(hostname) {a..z}'

$LANG $(hostname) {a..z}

2.双引号:对双引号里面的特殊符号进行解析    $ $() ``

[root@oldboyedu-40-nb ~]# echo "$LANG $(hostname) {a..z}"

en_US.UTF-8 oldboyedu-40-nb {a..z}

3.不加引号:不加引号的时候与双引号类似 支持 {a..e}

[root@oldboyedu-40-nb ~]# echo $LANG $(hostname) {a..z}

en_US.UTF-8 oldboyedu-40-nb a b c d e f g h i j k l m n o p q r s t u v w x y z

老男孩教育每日一题-2017-04-14-说一下单引号、双引号和不加引号区别

http://lidao.blog.51cto.com/3388056/1916108

第12章 linux无法上网如何解决(DNS配置故障 排查过程)

couldn't    resolve

unknown  hostname  

      1.ping www.baidu.com

      2.ping 223.5.5.5

      排查DNS配置的是否正确

    如果1,2都不通

    排查

1.ip是否正确

ifconfig

2.网卡中-DNS和网关

DEVICE=eth0

TYPE=Ethernet

ONBOOT=yes

NM_CONTROLLED=yes

BOOTPROTO=none

IPADDR=10.0.0.200

NETMASK=255.255.255.0

GATEWAY=10.0.0.2

DNS1=223.5.5.5

DNS2=223.6.6.6

PEERDNS=yes

3.vmware软件问题--windows

1)5服务开启

2)编辑-虚拟网络编辑器

3)打开一个目录----网络连接

   

老男孩教育每日一题-第75天-linux无法上网或联网怎么办?

http://lidao.blog.51cto.com/3388056/1940340

   

   

第13章 打包压缩

tar     .tar.gz

   zcf  创建压缩包

   tf   查看压缩包内容

   xf   解压

zip  zip格式的压缩包 linux windows都可以用.

zip 压缩包名字  文件 文件 

unzip  解压zip格式的压缩包

[root@oldboyedu-40-nb ~]# zip  /tmp/ser.zip    /etc/services

  adding: etc/services (deflated 80%)

[root@oldboyedu-40-nb ~]# ll /tmp/ser.zip

-rw-r--r-- 1 root root 127370 Aug 29 06:23 /tmp/ser.zip

[root@oldboyedu-40-nb ~]# unzip /tmp/ser.zip

Archive:  /tmp/ser.zip

  inflating: etc/services           

[root@oldboyedu-40-nb ~]# ls

etc

[root@oldboyedu-40-nb ~]# tree etc/

etc/

└── services

第14章 回顾-扩展

1.服务器组成

2.GNU GPL

3.最小化及补救措施

4.屌丝去洗浴中心之路

5.第一关练习题---find

6.系统优化-如何彻底关闭软件

7.linux目录结构-必知必会文件

8.如何修改主机名

临时-永久-解析(/etc/hosts)

9.第二关

PATH,LANG

单引号 双引号

打包压缩 tar zip/unzip

awk指定多个分隔符(菜刀)

预习:

1.linux文件属性

ls -lhi 每一列的含义

原文地址:https://www.cnblogs.com/Arlen723/p/7846045.html