Questions tagged [process]

A process is an instance of a computer program that is being executed.

A process is an instance of a running computer program.

Obtaining information about processes

Some useful tools

  • top, htop: text-mode system monitors, showing process information in real time
  • lsof: list process open files. Also netstat specifically for network connections.
  • ptrace(): a programming interface to see all the system calls that a process is making. Different systems have different command line tools: strace on Linux, ktrace on *BSD, truss on Solaris, dtrace on FreeBSD and Mac OS X, …

Further reading

Keeping processes running

Some useful tools

  • screen: run programs in a detachable terminal that you can reattach to later from a different place
  • cron: schedule a task at regular intervals. Also at for a one-off.

Further reading

Other topics

Further reading

2587 questions
306
votes
12 answers

How to check how long a process has been running?

I would like to avoid doing this by launching the process from a monitoring app.
tshepang
  • 65,642
81
votes
3 answers

Which process has PID 0?

I'm looking for the process started in Linux which has process ID 0. I know init has PID 1 , which is the first process in Linux, is there any process with PID 0?
user9744
  • 721
  • 2
  • 8
  • 10
74
votes
4 answers

What is the maximum value of the Process ID?

What is the maximum value of the Process ID? Also, is it possible to change a Process ID?
21
votes
3 answers

I see pids above 400,000 why is that? Does it indicate something is wrong?

Today I just noticed that my process IDs are very high, in the 400,000 (i.e 449624). When I run ps -ef | more, that's when I noticed it. Is that normal or does that indicate a problem? Otherwise the scripts are running fine. I am using Redhat 7.3…
19
votes
3 answers

What is the difference between pidof and pgrep?

When I use either of these commands with an argument as the name of a process, both of them return the exact same number. Are they the same commands? Are they two different commands that do the same thing? Is one of them an alias to the other? pidof…
Galaxy
  • 505
19
votes
1 answer

"Kill the biggest process" button

This laptop has an SSD and therefore I decided to omit the swap. This works well in most cases, but sometimes the RAM gets a bit short and the computer gets really sluggish and tends to freeze up. Is there a way to implement a "kill the biggest…
18
votes
4 answers

Is it possible to find the path of a running program?

I have a xmms2d process running, but two possible executable files (in different directories, both in the executable path) that could have spawned it. I suspect that one of those is corrupted, because sometimes this program works and sometimes it…
Wolf
  • 3,045
16
votes
3 answers

How to check how long a process ran after it finished?

Currently I'm using the following to check how long a process is actually running: ps -eo uid,pid,etime | egrep '^ *MY_ID' | egrep 'PID_OF_PROCESS' And that outputs the following: MY_ID PID_OF_PROCESS 00:16 However, after the process ends I…
Diego
  • 399
11
votes
2 answers

What does it mean each process has a current directory?

I'm reading "The Unix Programming Environment", but I don't comprehend the concept current directory of process. Each process, has a current directory, and all filenames are implicitly assumed to start with the name of that directory, unless …
Rene Ott
  • 113
9
votes
1 answer

What are legitimate reasons for a program to need access to /proc/self/mem?

I have noticed that both browsers Firefox and Chromium on Linux do open the file /proc/self/mem for reading. No other program on my system reads this file, as far as I can tell. /proc/self/mem is notorious for being vector for endless privilege…
Martin Vegter
  • 358
  • 75
  • 236
  • 411
8
votes
2 answers

I accidentally paused the Linux display process

After installing Linux Mint 19 I wanted to check how vsinc affects fps in Linux, so I typed this command: CLUTTER_SHOW_FPS=1 cinnamon --replace After some time I accidentally pressed Ctrl+Z and paused that process. Immediately my Bash shell and…
8
votes
1 answer

What determines what PID a process will be assigned?

What determines what PID a process will be assigned? It seems as if there is an upper bound for the integer value that's used for the ID; what is this limit and where is it defined? Is there a range that is reserved for processes that are not…
chb
  • 634
6
votes
1 answer

Launch independent process

Possible Duplicate: How can I close a terminal without killing the command running in it? If I open a terminal emulator, type firefox & and then close the terminal, the process it launched -Firefox- gets killed as it was its child. How can I…
deprecated
  • 2,361
  • 4
  • 24
  • 23
6
votes
4 answers

Are the states of processes which are ready and scheduled to wait "S"?

In the output of top, the state S means interruptible sleep. What is the state of those processes which are scheduled to be ready and waiting for execution in CPU by the scheduler? Is it S or something else? Is there a state meaning idle? If yes,…
Tim
  • 101,790
6
votes
3 answers

What call before a fork?

A long while ago I went to a job interview with a thoroughly weird company in London who claimed to be expert Unix consultants. Anyway these people were complete nutters and not surprisingly the company doesn't seem to be there any more, but at the…
delete
1
2 3 4 5 6