mac上面常用的命令 for java 开发者


开启smtp 服务 在 mac上
Edit file:
sudo vim /System/Library/LaunchDaemons/org.postfix.master.plist.

Add <key>RunAtLoad</key> <true/> <key>KeepAlive</key> <true/> before the closing </dict> tag.
Run sudo postfix start.
Check that SMPT is running: telnet localhost 25

出现以下信息就说明成功了。
telnet localhost 25
Trying ::1...
Connected to localhost.
Escape character is '^]'.
220 your computer name.local ESMTP Postfix

set javahome,默认mac会用最新的jdk,如果你没有set的话

echo export "JAVA_HOME=\$(/usr/libexec/java_home -v 1.7)" >> ~/.bash_profile
关掉 terminal
重启terminal
输入  java -version
===================================================
关掉tomcat 进程
http://stackoverflow.com/questions/15236308/how-do-i-kill-this-tomcat-process-in-terminal

pkill -9 -f tomcat

查找tomcat 进程
ps -ef | grep tomcat => Get all processes with tomcat grep
Once we have process details, we pipe it into the part 2 of the script
awk '{print $2}' | xargs kill -9 => Get the second column [Process id] and kill them with -9 option


通用的做法
ps -ef
will list all your currently running processes

| grep tomcat
will pass the output to grep and look for instances of tomcat. Since the grep is a process itself, it is returned from your command. However, your output shows no processes of Tomcat running.
=====================================================



猜你喜欢

转载自ycljf86.iteye.com/blog/2313834