进程的切换:
1) ./server & 进程后台运行
2) jobs 列举jobs
3) 把前台运行的程序放到后台运行
To place a foreground process in the background: suspend the foreground process (with Ctrl-z) then enter the bg command to move the process into the background.
Show the status of all background and suspended jobs: jobs
Bring a job back into the foreground: fg %jobnumber
Bring a job back into the background: bg %jobnumber
4) ssh登陆远程linux(不用密码):ssh login without password using os x
ssh root@192.168.0.100
5) 远程拷贝
scp config.log root@192.168.0.100:~/log
拷贝目录
scp -r ./log root@192.168.0.100:~/
6) mac 下开启一个新的terminal:
osascript -e 'tell app "Terminal" to do script "cd ${CURDIR}\n pwd\n" '
7)结束指定的进程
ps -ef | grep ./server | grep -v grep | awk '{print $2}' | xargs kill -9
8) 修改命令, 把命令xdg-open改名为xopen,并放到/usr/bin目录下,
cd /usr/bin
ln -s xdg-open xopen
相关参考:
how can i bring the background process to foreground
make a foreground running process to run background without hang up