1.tar命令解压去掉(跳过)第一层目录 tar -zxvf finename.tar.gz -C ./ --strip-components 1

2.sed命令 #删除最后一行 sed -i '$d' filename

sed命令删除包含特定字符行 #删除包含"xxx"的行 sed -i '/xxx/d' filename

3.find命令 #查找根下任意字符的文件并删除 find / -name * -exec rm -r {}

#查找根下两天以前的文件并删除 find / -mtime +2 |xargs rm -r

#查看/data目录下两天以前的文件并删除 cd /data;ls -t |awk 'NR > 2' |xargs rm -r rpm -qa | grep java | xargs rpm -e --nodeps

4.java配置 wget下载jdk

wget -P /usr/local/src  --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u131-b11/d54c1d3a095b4ff2b6607d096fa80163/jdk-8u131-linux-x64.tar.gz 

环境变量配置 export JAVA_HOME=/usr/local/java/jdk-11.0.8 export PATH=.:$JAVA_HOME/bin:$PATH export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar

5.jenkins更换清华源 [root@localhost ~]# find / -name "default.json" /var/lib/jenkins/updates/default.json [root@localhost ~]# sed -i 's/http:\/\/updates.jenkins-ci.org\/download/https:\/\/mirrors.tuna.tsinghua.edu.cn\/jenkins/g' /var/lib/jenkins/updates/default.json && sed -i 's/http:\/\/www.google.com/https:\/\/www.baidu.com/g' /var/lib/jenkins/updates/default.json [root@localhost ~]# systemctl restart jenkins

6.创建虚拟tun mkdir /dev/net -p

mknod /dev/net/tun c 10 200

chmod 666 /dev/net/tun