Sunday, July 23, 2006

Managing Foreground and Background Jobs and Processes [32-40]

Unix system administrators often need to switch and move jobs from foreground to background and vice versa.
[32] To stop (not kill) a currently running job and return to shell, you can use Ctrl-z.
[33] Then to view the stopped jobs during the current session
[34] To kill a stopped job number 2
kill -9 %2
[35] Check the status of processes in all sessions running by user frankly
ps -u frankly
[36] Kill a process by its process id (822)
kill -9 822
[37] Bring the job that was sent most recently sent to run in background to foreground
[38] Bring the background job with job id 2 to run in the foreground
fg %2
[39] Start running the most recently stopped job in the background
[40] Run a job in the background
Add & to end of the command

Sunday, July 16, 2006

Copy MySQL tables between different hosts [31]

The following command will allow you to copy MySQL tables between different hosts

mysqldump -h ip -uuser -ppass from_db from_table | mysql -uuser -ppass target_db