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

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

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

出现以下信息就说明成功了。
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
===================================================
[b]关掉tomcat 进程[/b]
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.
=====================================================
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值