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

开启smtp服务在mac上

Editfile:

sudovim/System/Library/LaunchDaemons/org.postfix.master.plist.

Add<key>RunAtLoad</key><true/><key>KeepAlive</key><true/>beforetheclosing</dict>tag.

Runsudopostfixstart.

CheckthatSMPTisrunning:telnetlocalhost25

出现以下信息就说明成功了。

telnetlocalhost25

Trying::1...

Connectedtolocalhost.

Escapecharacteris'^]'.

220yourcomputername.localESMTPPostfix

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

echoexport"JAVA_HOME=\$(/usr/libexec/java_home-v1.7)">>~/.bash_profile

关掉terminal

重启terminal

输入java-version

===================================================

关掉tomcat进程

http://stackoverflow.com/questions/15236308/how-do-i-kill-this-tomcat-process-in-terminal

pkill-9-ftomcat

查找tomcat进程

ps-ef|greptomcat=>Getallprocesseswithtomcatgrep

Oncewehaveprocessdetails,wepipeitintothepart2ofthescript

awk'{print$2}'|xargskill-9=>Getthesecondcolumn[Processid]andkillthemwith-9option

通用的做法

ps-ef

willlistallyourcurrentlyrunningprocesses

|greptomcat

willpasstheoutputtogrepandlookforinstancesoftomcat.Sincethegrepisaprocessitself,itisreturnedfromyourcommand.However,youroutputshowsnoprocessesofTomcatrunning.

=====================================================

mac

相关推荐