Summary of knowledge points to 3

A, sed parameters

sed:
-n: Use quiet (silent) mode. In general usage of sed, all data from STDIN generally will be listed on the screen.
However, if after adding -n parameter, only through the line sed special treatment (or action) will be listed.
-e: directly on the command line mode of operation of editing sed; (multi-line command, similar -e grep)
-f: sed operation directly written in a file, filename -f filename may be performed within the sed action;
-R & lt: sed operation support extended-formal syntax notation. (Default is the basis of regular expression French and France)
-i: directly modify the contents of the file to read instead of the output from the screen.
Action Description: [N1 [, n2]] function
N1, n2: not necessarily exist, usually on behalf of "the number of rows selected for action", for example, if my actions
are needed between 10-20 rows , the "10, 20 [action behavior]"
function there under these options:
a: new, can take back a string, and those strings will appear (currently the next row) in a new line
c: to replace, c may be connected to the back of strings that can be substituted n1, N2 between the line!
d: delete, because it is deleted, so the back d usually do not take anything;
i: insert, i can take back the string, and those strings will appear (on the current line) in a new line;
the p-: print, That will be a selection of print data. P will operate normally with the parameters sed -n
s: replace, the work can be substituted directly, usually this s action can be used with regular expression!

Two, rpm installation package

Check that the installation package, the package name must be exact (the difference under the package name and file name)

 

Command is implemented packet detection installation

 

--replacepkgs to cover all rreplacetiles to cover separate a separate file

 

 

See installation tree package files generated, rpm2cpio format conversion, and preview the contents of the package

 

-qp    query is not installed package, -p : is followed by an rpm file name, and the need to bring the full path. It is not limited to only check not installed.

 

 

Fuzzy look

 

 

Query files belong to which package    

 

rpm -e   package name unloading packages and append a newline to the tree file

 

Repair Software:

Enter rescue mode;

Specifies the root directory;

Repair.

 

Secret key (identification document)

 

Importing keys

 

Keys imported successfully

 

rpm -ql   package name: Query Builder After installing the software run by file

rpm -q --provides   package name: The software provides the ability to query those of

rpm -qf    file path: after viewing the file to install the software package generated

rpm -q    package name: to see whether the system is to install the package

-qa rpm   : View system installed above all rpm packages

 Three, yum installation package

客户端yum配置文件路径固定为:/etc/yum.repos.d/*.repo

本地挂载光盘->yum的配置文件/etc/yum.repos.d/目录下,创建任意一个以.repo结尾的文件。->在该文件中输入(   NAME为要输入内容。[NAME];name=NAME  baseurl=(https|http|ftp|file://NAME);gpgcheck=(0|1);gpgkey=file:///mnt/RPM-GPG-KEY-CentOS-7;enable=(0|1))再执行yum repolist 即可。

 

 repodata所在目录为yum源路径(httphttpsftpfiles(本地路径)      :)

yum缓存地址  /var/cache/yum

yum clean all(清除yum缓存,避免yum源地址发生变化,由于旧的yum源缓存无法访问新的yum

 

实现光盘自动挂载:

vim  /etc/fstab  ->   在文件末尾添加内容   /dev/cdrom   /mnt (挂载点)  iso9660 defaults(文件系统),loop  0(能否被dump指令备份) 0(是否以fsck检验扇区)

 

/etc/fstab是开机时的配置文件,实际filessystem的挂载时记录到/etc/mtab/proc/mounts这两个文件当中的。若/etc/fstab输入的数据错误,导致无法顺利开机,进入单人维护模式当中,/(根)是只读状态,无法修改/etc/fstab,也无法更新/etc/mtab,此时可以使用 mount -n -o remount,rw   /(重新挂载根)

光盘挂载:

 mount -t   iso9660   /dev/cdrom    /mnt

dd if=/dev/zero of=/srv/loopdev bs=1M count=512(生成一个512M的文件) 

# if input file ,输入文件。那个 /dev/zero 是会一直输出 0 的装置!

# of output file ,将一堆零写入到后面接的文件中。

# bs 是每个 block 大小,就像文件系统那样的 block 意义;

# count 则是总共几个 bs 的意思

查看yum历史操作

 

使用yum安装rpm

 

yum provides   :查看指定特性(可以使某文件)是由那个程序包所提供的

yum info:查看程序包的信息 

yum search:以指定关键字搜索程序包名及概要信息

yum history

yum history info 6

yum history undo 6

yum history redo 6

启动httpd服务

 

 entos7中关闭防火墙及selinux

systemctl status firewalld     查看centos7防火墙的状态

systemctl stop/start  firewalld  开启关闭防火墙

getenforce   查看selinux状态

setenforce 0  临时关闭selinux

修改  /etc/selinux/config    关闭开启SElinux

centos6中关闭防火墙及selinux

service iptables status    查看防火墙状态

service iptables  start/stop   开启。关闭防火墙

centos6中关闭开启selinuxcentos7相同

基于http协议的yum

 

yum.txt可以输入多条yum源路径

 

wget直接下载文件

 

 对现有包构建yum源,构建repodata(在包所在目录中执行createrepo

 

安装编译所需工具

 

 编译安装后启动httpd

 

 yum info httpd(查看httpd包相关信息)

./configure --help(编译安装帮助)

 

 

 设置多线程并行编译

 

yum  search   关键字    (查询与关键字相关的包)

 

 执行make install命令实现最后一步编译安装。

 临时启动httpd

 

 设置服务开机自动启动,修改 /etc/rc.d/rc.local文件  后再加权限。

 

 

 httpd页面信息存放在htdocs

 

通过网络直接执行脚本;使用bash执行脚本不需要加执行权限。

 

 

Guess you like

Origin www.cnblogs.com/FightMG/p/10963483.html