[Unix]常用命令

进程的切换:

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 [email protected]

5)  远程拷贝

scp config.log [email protected]:~/log

拷贝目录

scp -r ./log [email protected]:~/

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

nohup wiki

make a foreground running process to run background without hang up

你可能感兴趣的:(unix,command,Terminal,jobs)