# Was常用命令

1.启动、停止

#切换目录
cd /opt/IBM/WebSphere/AppServer/profiles/AppSrv01/bin

#启动
./startServer.sh server1

#停止
./stopServer.sh server1
1
2
3
4
5
6
7
8

2.war包解压目录

cd /opt/IBM/WebSphere/AppServer/profiles/AppSrv01/installedApps/localhostNode01Cell/
1

3.was日志

cd /opt/IBM/WebSphere/AppServer/profiles/AppSrv01/logs/server1

tail -f SystemOut.log
1
2
3

4.应用日志

cd /opt/IBM/WebSphere/AppServer/profiles/AppSrv01/logs/APP应用名
1

5.常用日志查询

#查询关键词为'test'的所有后缀为.log.gz的日志 
gunzip -c *.log.gz | grep 'test'

#实时查询关键词为'test'的日志并用颜色标注
tail -f app.log | grep "test" --color=auto

#查询关键词为'test'的日志
cat app.log | grep "test"

#查询关键词为'test'的日志并输出到out.log文件
cat app.log | grep "test" > out.log
1
2
3
4
5
6
7
8
9
10
11