Linux 命令
Tomcat Debug启动
1
2
3 ./catalina.sh jpda start
默认启动.sh中的8000端口,指定端口命令
./catalina.sh jpda start -debug XXXX
springboot debug
1 java -jar -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005 yahu-rest2.jar --spring.profiles.active=test --spring.config.location=classpath:/application.properties,/etc/config/yahu/application-test.properties
查看端口
1
2
3
4
5
6
7
8
9
10
11 显示所有端口和所有对应的程序:
netstat -tunlp
某个端口
netstat -anp | grep XXXX
系统端口
netstat -anp
mac/centos查看端口情况
lsof -i tcp:port
mac svn 检出
svn co https://120.25.206.19:8443/svn/SCS/branches/baorong /Users/zhiyong/Documents/Code/ideaProjects/baorong
查看进程
1 ps -ef | grep (tomcat)
查看
1
2
3
4
5
6
7
8
9
10 regedit
cat
vim(:q/:q! 退出,:wq 保存)
tail -f 动态查看
tail -f -n (int) 查看最后多少行
搜索文件
grep -n "=========" (filePath)
(-n查看行数)
sed -n 10,20p (filePath)
查看10-20行数据
linux开机启动项
1 /etc/rc.d/rc.local
Centos开机启动项
1 /etc/rc.local
删除
1
2
3
4 直接rm就可以了,不过要加两个参数-rf 即:
-r 就是向下递归,不管有多少级目录,一并删除
-f 就是直接强行删除,不作任何提示的意思
rm -rf (filePath)
解压
1
2
3 tar zxvf (FilePath) -C
默认解压到当前路径,后面可加解压路径
uzip (FilePath)
linux查看设置编码格式
1
2
3
4
5
6
7
8 vi (FilePath)
//查看
:set ff / :set fileformat
//fileformat=dos 或 fileformat=unix
//设置
:set ff=unix 或 :set fileformat=unix
//保存
:wq
文件查找
1 find / -name 'ems-man*'
查看磁盘使用
1 df -lh
查看cpu内存使用
1 top
查看大于500M的文件
1 find / -type f -size +500M -print0 | xargs -0 ls –l
centos 环境变量
1
2
3
4 export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE INPUTRC
export JAVA_HOME=/data/java/jdk8
export PATH=$PATH:$JAVA_HOME/bin:$JAVA_HOME/jre/bin
export CLASSPATH=.:$JAVA_HOME/lib:$JAVA_HOME/jre/bin:$CLASSPATH
1 | vi /etc/profile |
centos 卸载 软件 eg.openJDK
1
2
3
4 rpm -qa|grep java
rpm -e --nodeps ****
安装
rpm -ivh
用户管理
1
2
3
4
5 新增 useradd
更改密码 passwd
查看用户 /etc/passwd
查看组 /etc/group
v1.5.2