0
votes
2answers
81 views

Is there a way to create a process which can be killed by anyone in Linux?

For example, I would like to start running a process in the background SECRETLY on a Ubuntu server , but whenever anybody except me logins to the server, the process must be killed by that user. Is it ...
1
vote
1answer
587 views

How to find out is a program run with nohup or not?

There is no difference in ps -ef | grep sleep output to commands: nohup sleep 60 & sleep 60 & In which way can I discover that program is run with nohup?
3
votes
1answer
542 views

How to get list of all child process spawned by a script

Context: Users provide me their custom scripts to run. These scripts can be of any sort like scripts to start multiple GUI programs, backend services. I have no control over how the scripts are ...
26
votes
3answers
25k views

If I know the PID number of a process, how can I get its name?

If I have the PID number for a process (on a UNIX machine), how can I find out the name of its associated process? What do I have to do?
2
votes
1answer
313 views

Is it possible to kill a loop in bash without killing the instance of bash running the loop?

Suppose I execute (in an interactive bash shell) a loop that spawns a bunch of processes in sequence, such as the following. for i in `seq 15 42`; do if [ -f F$i.flv.mp3 ]; then play F$i.flv.mp3; fi; ...
4
votes
3answers
1k views

What does kill 0 do actually?

In the man page, it says: 0 All processes in the current process group are signaled And I tried like this: $ man kill & [1] 15247 $ [1]+ Stopped man kill $ kill ...
2
votes
3answers
1k views

What's a reliable technique for killing background processes on script termination?

I use shell scripts to react to system events and update status displays in my window manager. For example, one script determines the current wifi status by listenining to multiple sources: ...
0
votes
2answers
155 views

How to start a local server and open it in a browser from a shell script

I have a test suite which runs in a browser (using QUnit, though that's unimportant). The test suite requires a local server running on a particular port. Running the tests currently involves a few ...
2
votes
2answers
1k views

Show PID of process just launched in ZSH

Can I show the PID of a process that I just launched, ideally at the end of the line of the command? Example: root in ~: mysqld .................. [PID 34567] 12121 mysql-logs start to come in... ...
2
votes
1answer
71 views

How to only show new processes in Activity Monitor?

Is there any way to make Activity Monitor only show new processes? Can you do this in Terminal instead?
6
votes
1answer
9k views

How can I kill Firefox by console?

I know I can type: ps -A | grep firefox I get something like: 6818 ? 00:04:23 firefox Now I can kill it by means of: kill -9 6818 How can it be done in one command and how can I make ...
2
votes
3answers
276 views

How to suspend bash within bash

Is it possible to suspend a bash that was invoked by another bash? For example, if I use su to become a different user but want to switch back to my own user for a moment. For another example, in an ...
4
votes
1answer
682 views

We have already running windows process. How to determine what parameters it has been ran with?

For example I have a running process seen in windows task manager (.exe). I'd like to see the parameters that's been passed to the process when it was started. I do not start this proces, nor I have ...
0
votes
1answer
2k views

Ubuntu 10.04 LTS - jobs command not working

When I used to execute the jobs command I got a list of running processes with their respective process-ID, but in Ubuntu lucid lynx this doesn't seem to be working. Anyone have a solution?
1
vote
4answers
2k views

Python: Check existence of shell command before execution

I'm trying to find a way to check the existence of a shell command before its execution. For example, I'll execute the command ack-grep. So, I'm trying to do: import subprocess from subprocess ...
1
vote
2answers
59 views

Remote execution stops when local computer boots

When I run a process on a remote Linux machine, the process stops if the connection is terminated for some cause. This behavior is reasonable, because otherwise irrelevant processes would keep running ...
19
votes
3answers
7k views

Screen a running process

Sometimes I forget to run a program under a screen session and can't stop it in the middle, and I know it's going to take long. Is there a way to screen an already running process without restarting ...
23
votes
4answers
2k views

Difference between “a=b” and “export a=b” in bash

What's the difference between: a=b and export a=b In bash? I understand that they both define environment variables, but I don't fully understand the difference.