常用命令大全
宝塔
默认安装为https访问,取消https命令如下
rm -f /www/server/panel/data/ssl.pl && /etc/init.d/bt restart
命令行修改访问端口
cd /www/server/panel/data
vi prot.pl
systemctl restart bt
linux
搜索本文件夹内所有文件中某字符串
grep "Leave a Comment" * -Rn
当前文件夹 批量转换成unix文件
for x in $(find . -type f);do dos2unix $x $x;done
查询进程启动时间
Linux系统下查看进程启动时间和运行时间的命令
ps -o lstart -p PID #根据PID来查询
ps -o lstart,etime -p PID #根据PID来查询,打印出启动时间和已经运行的时间
ps -eO lstart | grep PROCESS #根据进程名字查询
提示:
1, 大写的O表示preloaded,小写的o表示user-defined,e表示all processes
2, 如果查出来的时间是1-16:15:58, 则表示该运程运行了1天16小时15分钟
3, etime表示elapsed time, 即程序已经运行的时间
根据端口查询进程ID
lsof -iTCP:22 -sTCP:LISTEN
vi出现乱码,以指定编码格式重新打开本文件,在vi中执行
:e ++enc=utf-8
linux下查询文件MD5
md5sum /www/wwwroot/1011.zip /www/wwwroot/1011.zip2 /www/wwwroot/1011.zip3
vi全词匹配替换文件内字符串
%s/oldstring/newstring/g
阿里云增加磁盘
yum install cloud-utils-growpart xfsprogs -y
growpart /dev/vda 1
— 不同类型的 执行不同的 《可用 blkid查看》 xfs_growfs / —-> xfs resize2fs / —-> ext4
整理来自皮总