MAC查看端口占用情况
lsof -i tcp:port
#(port替换成端口号,比如6379)可以查看该端口被什么程序占用,并显示PID,方便KILL
显示系统路径
defaults write com.apple.finder _FXShowPosixPathInTitle -bool YES
Mac 压缩包加密
# 单文件
zip -q -e ceshi.zip Dolist.txt
# 文件夹
zip -q -e -r ST.zip ST
# 解释
zip -q -r -e -m -o xxx.zip yyy
# 注: (yyy:原来的文件名 , xxx:压缩包名字 前面命令可以根据个人需求增减)
# -q 表示不显示压缩进度状态
# -r 表示子目录子文件全部压缩为zip //这部比较重要,不然的话只有something这个文件夹被压缩,里面的没有被压缩进去
# -e 表示你的压缩文件需要加密,终端会提示你输入密码的
# -m 表示压缩完删除原文件
# -o 表示设置所有被压缩文件的最后修改时间为当前压缩时间
mac下,svn工程目录改变时,清除svn账号和密码问题
# 进入home目录
cd ~
# 列出所有文件
ls -al
# 进入保存svn用户名和密码的auth目录
cd .subversion/auth
# 删除该目下下所有文件
rm -rf *
ssh 异常
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that the RSA host key has just been changed.
The fingerprint for the RSA key sent by the remote host is
28:24:ac:e6:84:e3:16:26:c0:65:66:d7:51:8f:6a:6c.
Please contact your system administrator.
Add correct host key in /root/.ssh/known_hosts to get rid of this message.
Offending key in /root/.ssh/known_hosts:1
RSA host key for 192.168.1.152 has changed and you have requested strict checking.
Host key verification failed.
fatal: The remote end hung up unexpectedly
原因是系统有改变,导致加密的密钥改变,因此本地保存的密钥失效;
需要重新保存密钥在 ~/.ssh/known_hosts 中。
解决方法:
删除 ~/.ssh/known_hosts 文件中指定ip的密钥即可。