常用命令

查看文件日志(滚动-实时)

tail -f ***.log

cat 全部文件

cat a.log

查找日志

grep -i "查找的关键字" ***.log -a10 -b10

其中 -a10,-b10可以不用

-a10 关键字前面10行

-b10 关键字后面10行

查看进程

ps -ef |grep member-service

杀死进程

kill -9 进程id

查找文件

find / -name a.log 

从根目录下面开始查找 a.log文件

find . -name a.log 

从当前目录下面开始查找 a.log文件

ftp

sftp -oPort=端口 用户名@host

查找文件内容

find ./ -type f -name "*.properties" |xargs grep "7ABA98CAE6B90EF269F4B130235FD891"

替换文件内容

 find ./ -type f -name "*.properties" |xargs sed -i "s#7ABA98CAE6B90EF269F4B130235FD891#27BB33F9D23F2BC98C9B6CED5533BB8D#g"
注意# ,s#原字符串#替换后字符串#g

查看端口(80)占用情况

netstat -antp |grep 80

results matching ""

    No results matching ""