阿尼樱奈奈
2023-07-07 01:10 Moderator
Reply Like 0 View the author
如果你要直接把密码放到命令里面,那么直接查看shell输入命令的历史记录就有了
你为什么要这么做呢
kill就行了,这么麻烦干什么
kill就行了,这么麻烦干什么
我写脚本的目的就是不想记住任何命令
不然你要记忆2个命令 才能最后 kill ID 尤其是管道命令一个接一个不好记忆,
如果你要直接把密码放到命令里面,那么直接查看shell输入命令的历史记录就有了
你为什么要这么做呢
这个有时候脚本考虑不到那么多,在历史记录里 只要把脚本名字改一下就不好判断是做了什么,也可以在脚本后面加上清空命令就没有历史记录了
把密码写在脚本里面也可以,只不过没有必要
很久没看到带注释的脚本了,大佬👍
Popular Events
More
其它功能脚本:https://note.youdao.com/s/BBlPM7OJ
./lsofPORT 端口 用户密码
使用方法 普通用户下需要输入用户密码
普通用户下 ./lsofPORT 12345 abc123
ROOT用户下 ./lsofPORT 12345
注意事项:
请勿使用 sudo ./lsofPORT 应为在普通用户下密码已经作为第二个参数传递到了脚本内部
该脚本应为涉及到用户密码为了安全一点请使用shc加密处理
把下面代码保存到文本文件