I want to know the procedure so that i can access or get control from terminal over the process running on some other terminal in Linux .
You can use the ps command to find out which processes are running and display information about those processes. The ps command has several flags that enable you to specify which processes to list and what information to display about each process.
You can use the below line to check what your process is doing. $ strace -p $! $! gives the process ID of the last background process.
Open the terminal window on Unix. For remote Unix server use the ssh command for log in purpose. Type the ps aux command to see all running process in Unix. Alternatively, you can issue the top command to view running process in Unix.
Pehaps you want something like reptyr
? (https://github.com/nelhage/reptyr)
You simply type reptyr PID
to 'gain control' of another process (like vim or whatnot).
Edit:
This question has more information on using screen or tools like reptyr.
Use the screen utility to start any process from terminal, so that you can access the same process from any other terminal either locally or remotely. For instance:
screen -dR test
and hit Enter, you will get shell within in screen.screen -x test
Now you should be able to see process running on first terminal, and will have the full control over that process.
You can investigate more on screen utility… its a very useful tool for any system administrator.
Hope the above tip will help you.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With