1.iconv 编码转换
Linux下将UTF8文件转换为Windows的ANSI编码
iconv -f UTF8 -t CP936 cici.csv > cici_cp936.csv
iconv linux 中文乱码转换
2.grep
echo "v1.33.2"| grep -E "^v[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}#34;
3.chown
修改带点的账号属性
chown -R shiye.meng:shiye.meng shiye.meng
4.chage
查看账户详细信息
for i in `cat forbidden_user.txt`;do echo $i;chage -E $i; done
chage -E 2010-12-12 babydog2
chage -E 2019-06-30 david.sun
chage -E 2018-09-30 alan.lian
5.du和df
du df 的差别
du -ach * #这个能看到当前目录下的所有文件占用磁盘大小和总大小
du -sh #查看当前目录总大小
du -sh * #查看所有子目录大小
lsof | grep delete #如果怀疑删掉的数据还在占用磁盘空间试试这个
kill -9 pid #结束掉进程就能释放磁盘空间了
#for i in `lsof | grep delete | awk '{print $2}'`; do kill -9 $i ;done
当 df -h 查看空间占用非常高
通过du -sh /
[root@l_svr_83 /]# du -sh *
7.7M bin
26M boot
4.0K cgroup
通过计算并非占有23G
[root@l_svr_83 /]# lsof |grep delete
java 14573 tomcat 1w REG 252,3 20505740805 661556 /opt/apache-tomcat-7.0.64/logs/catalina.out (deleted)
java 14573 tomcat 2w REG 252,3 20505740805 661556 /opt/apache-tomcat-7.0.64/logs/catalina.out (deleted)
java 14573 tomcat 7w REG 252,3 46529 661899 /opt/apache-tomcat-7.0.64/logs/catalina.2016-05-30.log (deleted)
java 14573 tomcat 8w REG 252,3 0 661893 /opt/apache-tomcat-7.0.64/logs/localhost.2016-05-28.log (deleted)
java 14573 tomcat 9w REG 252,3 0 661894 /opt/apache-tomcat-7.0.64/logs/manager.2016-05-28.log (deleted)
java 14573 tomcat 10w REG 252,3 0 661895 /opt/apache-tomcat-7.0.64/logs/host-manager.2016-05-28.log (deleted)
6.envsubst