shutdown now立即关机
shutdown -P关机(1分钟后)
shutdown 0立即关机
shutdown 33分钟后关机
shutdown -r 重启(1分钟后)
shutdown -c取消
shutdown -r now 立即重启
eg:ls="ls --color"
ls正常使用ls原本的命令,不使用其别名
history -c清除当前用户的历史命令 (echo > ~/.bash_history)
ctrl+r:用Ctrl+R搜索历史命令;当你执行了一串相当长的命令之后,你只要用关键字搜索一下历史命令然后重新执行这条命令而不需要将整条命令再输一遍。方法是:按下Ctrl+R然后输入关键字。如搜索”date”,则显示历史的命令中含有”date”的命令 date "+今天是:%F,%A,时间是:%T.准备吃饭去"。按回车,就可以重新执行这条命令了,而按左箭头键或右箭头键则可以直接修改,改完之后按回车执行,非常方便!(reverse-i-search)
history number 执行第几条命令
!! 执行上条命令
-w: (--word-regexp)
lvresize
elinks文本浏览器
-dump:将HTML文档以纯文本的方式打印到标准输出设备;
指定URL后可以访问网页
./configure
setenforce 1
break跳出循环
continue 跳出本次循环,继续下次循环
111. dd if=/edv/zero of=test bs=100M count=2
1.tcp面向连接,可靠传输,消耗系统资源比较多,传输速度较慢,
yum install samba -yvim /etc/samba/smb.conf[ren]path = /renread only = nopublic = yessed -i '$a [ren] path = /ren read only = no public = yes' /etc/samba/smb.confsystemctl restart smbuseradd kenpdbedit -a -u kensmbpasswd -a kenchmodmount -t cifs -o username=USERNAME password=PASSED //ServerIP/ShareDIR /LocalDIR
vsftpd:主动和被动模式:参照物是server端主动模式就是服务器端主动连接客户端被动模式就是服务器端等待客户端连接主动模式过程:
客户端通过21端口,发送密码,用户port指令,服务器端相应客户端
服务器端使用20端口主动连接客户端的随机高位端口,客户端要返回确认,开始传输数据
被动模式过程:
客户端通过21端口,发送密码,用户pasv指令,服务器端相应客户端
服务器端使用随机高位端口主动连接客户端的随机高位端口,客户端要返回确认,开始传输数据
useradd ren01/etc/vsftpd/vsftpd.conf
anonymous_enable=NO
vim /etc/ntpd.confserver 127.127.1.0restrict 127.0.0.1restrict 192.168.11.5 mask 255.255.255.0ntpstatntpdate
/etc/chrony.conf
allow 192.168.10.0/24
systemctl restart rpcbind nfs-utils/etc/exportsesportfs -r/ren192.168.11.5/32(rw)showmount -e ServerIPmount -t nfs ServerIP:/ShareDIR /LocalDIR
/usr/share/doc/dhcp-*/dhcpd.conf.example/etc/dhcp/dhcpd.conf
subnet 192.168.11.0 netmask 255.255.255.0 {
range 192.168.11.10 192.168.11.200;}
yum -y install bind bind-utils/etc/named.conf/etc/named.rfc1912.zones/var/named/named.localhost A: 正向解析/var/named/named.loopback PTR: 反向解析nslookup
/etc/httpd/conf/httpd.conf/etc/httpd/conf.d/*.conf
Listen 81
<VirtualHost *:81>
ServerName a.com
DocumentRoot /work/html1
<Directory "/work/html1">
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
</VirtualHost>
directoryindex/etc/hostsLAMP:yum install httpd php php-mysql mariadb-server -y日志:/var/log/httpd/
8005:8009:8080:
/etc/nginx/nginx.conf/etc/nginx/conf.d/*.conf
server {
listen80;
server_namea.com;
location / {
root /work;
}
}
反向代理
proxy_pass
负载均衡upstream
LNMP
yum install nginx php php-fpm php-mysql mariadb-server -yfastcgi_pass 127.0.0.1:9000;include fastcgi.conf;location ~ .php$ {fastcgi_pass 192.168.64.5:9000;include fastcgi.conf;}
yum install cobbler dhcp httpd syslinux xinetd tftp-server pykickstart -yvim /etc/dhcp/dhcpd.confsystemctl restart dhcpdsystemctl enable dhcpdvim /etc/xinetd.d/tftpdisable = nosystemctl restart xinetdsystemctl enable xinetdsystemctl restart httpdsystemctl restart cobblerdcobbler checkvim /etc/cobbler/settingssed -i '384s/127.0.0.1/$IP/g' /etc/cobbler/settingssed -i '272s/127.0.0.1/$IP/g' /etc/cobbler/settings
systemctl restart rsyncd101 default_password_crypted:" "
systemctl restart cobblerd
cobber checkcobbler syncmount /dev/cdrom /mntcobbler import --path=/mnt --name="centos7.5"kickstart:url --url=http://cobbler profile add --kickstart=/var/lib/cobbler/kickstart/ks.cfg--distro=centos7.5_x86-64 --name="centos7.5_ken"
yum -y install dhcp tftp-server xinetd syslinux httpd
12. SVN
yum -y install svn
vim /etc/sysconfig/svnserve
/var/svn/ren
authz passwd svnserve.conf
svn checkout
svn update
1. IP正则:“^([0-9].|[1-9][0-9].|1[0-9][0-9].|2[0-4][0-9].|25[0-5].){3}([1-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-4])$”
密码(至少八位,包含大小写字母,数字) :“egrep [a-z] |egrep [A-Z] |grep [0-9] |grep ^.{8,}$”
2. if 条件
then
elif 条件 ;then
else
fi
3. for 变量 in 范围
do
done
4. while :
do
done
break exit continue
5.case