If you want to work on Unix Operating system then you should know the basic commands of it.
Now, I am going to share very basic Unix process commands and using them you will be able to manipulate Unix processes very easily. There are many commands used for different-different purposes, I have divided them into several sections. “Process Control” is one of the sections which we will be discussing it now.
Commands used to run or to control Unix processes:
ps : Using this command you can print stats of processes. Stats included the path of the processes, name of the processes, id and many more things.
sleepn : If you want to be idle for some time then you can use this command. You can use this command any time you want.
jobs : It prints all jobs information
Ctrl + c : This command is used to interrupt running processes. It is one of the best and most useful commands in unix. If you don’t know what is happening on shell and if anything hanged then you can use this command to come out of that running process. It is one of my favorite commands as well.
Ctrl + : This command is very similar to above command Ctrl + c but Ctrl + more powerful than Ctrl + c. Ctrl + used mostly when terminal is hanged and not responding at all.
kill -9 PID : It removes/kills all instance of running process PID, where PID is the process ID.
bg [%n] : Resume background job n, where n,where n is the Process ID mentioned in [ ]. This is not a PID of the process.
Ctrl + s : You can stop screen scrolling using this command
Ctrl + q : Resume screen output
Ctrl + z : You can suspend current running process on the shell. Using this command you cannot suspend background running processes
stop %n : Suspend background job n, where n is the Process number mentioned in [ ] when you list all running jobs. Note that this is not a Process ID (PID) of the process.
& : This command is useful when you want to continue to work on Unix shell and also want to keep any process simultaneously running in the background. This command will return you the Process ID (PID) which you can use later to check status of that process. command is your own command or process that you want to run in background and just append & after it.
fg [%n] : This command resumes foreground job n, where n is the Process number mentioned in [ ] when you list all running jobs. Note that this is not a Process ID (PID) of the process.
top : Very useful command when you want to see all processes information consuming more memory. This command mostly used when you want to do performance monitoring of your system.
exit : Exit from shell
Now you all should be able to perform Unix process related operation very easily.
Most of the commands I have listed above. If you still have any questions or if you are still not clear about any of the above listed commands then please write me. I will try to answer your queries.