CMD常用命令

1、停止占用端口的应用

查找到占用端口的进程号PID

1
netstat -ano | findstr 80

假设输出:

1
TCP    0.0.0.0:8501           0.0.0.0:0              LISTENING       2692

停止进程

1
taskkill /F /PID 2692

2、修改文件名称

命令

1
2
ren	c.txt	cc.txt
ren d.txt dd.txt

Shell命令记录

1、shell结果赋值变量

pwd 的输出被赋给变量 currPath,打印currPath,创建bin目录

1
2
3
currPath=$(pwd) 或 $ currPath=`pwd`
echo $currPath
mkdir $currPath/bin

2、根据pid查询Jar位置

1、使用命令查询pid 2、根据pid查询jar路径

1
2
ps -ef|grep java
ll /proc/$pid/cwd

StringTable学习

习题一(JDK1.8) public class TestStringTable {      //运行环境JDK1.8     public static void main(String[] args) {         String s1 = "a";         String s2 = "b";         String s3 = &quo...
阅读更多