Questions tagged [process]

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

Filter by
Sorted by
Tagged with
23
votes
2answers
16k views

Alternative to iotop for non-root user without sudo privileges

I'm looking for an alternative to iotop. Here's my situation: I want to find out if a program is accessing the hard drive a lot while running. iotop requires root/sudo privileges. My account is on ...
22
votes
4answers
26k views

After fork(), where does the child begin its execution?

I'm trying to learn UNIX programming and came across a question regarding fork(). I understand that fork() creates an identical process of the currently running process, but where does it start? For ...
22
votes
1answer
17k views

How to tell if a running program is 64-bit in Linux?

In Mac OS X, I could use the Activity Monitor program to see if a running program/process is 64-bit. How do I do that in a Linux OS, regardless of flavour?
22
votes
4answers
25k views

killall gives me `no process found ` but ps

Could somebody explain to me the difference between kill and killall? Why doesn't killall see what ps shows? # ps aux |grep db2 root 1123 0.0 0.8 841300 33956 pts/1 Sl 11:48 0:00 ...
22
votes
3answers
2k views

Limiting a specific shell's internet bandwidth usage

I want update my linux in one shell but by default wget or axel in updater use all the bandwidth. How can I limit the speed in this shell? I want other shells to have a fair share, and to limit ...
22
votes
1answer
39k views

Why file-nr and lsof count on open files differs? [closed]

I am running into a problem all of a sudden; all my applications and the server was running fine and all of a sudden I see the number of open files shoot up. I am checking it with this command: cat /...
21
votes
4answers
47k views

Alternative way to kill a zombie process

I just noticed some zombie processes on CentOS 6.8(Final), tried to kill them but they are still there: [root@host user]# ps -ef | grep git tomcat 746 1 0 Jul18 ? 00:00:00 git clone ...
21
votes
2answers
5k views

How to find out what process is writing to STDOUT?

I have two instances of a process running. One of them is "frEAkIng oUT!" and printing errors non stop to STDOUT. I want to kill the broken process but I have to make sure I don't terminate the wrong ...
21
votes
2answers
25k views

How to locate a Chrome tab from its process PID?

I opened many Chrome tabs for webpages. Each tab has its own PID, e.g. USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND t 3900 1.9 6.3 5718440 508660 ? Sl ...
21
votes
4answers
86k views

How can I kill a particular thread of a process?

$ ps -e -T | grep myp | grep -v grep 797 797 ? 00:00:00 myp 797 798 ? 00:00:00 myp 797 799 ? 00:00:00 myp 797 800 ? 00:00:00 myp This shows the process myp ...
21
votes
3answers
2k views

Can other users view the arguments passed to a command?

If I invoke a command with arguments like so: bob@bob-pc:~$ command -arg1 -arg2 ...can other users view the arguments passed to the command?
21
votes
4answers
11k views

How do I wait on a program started in another shell

I have a program that does a large a amount of work (takes about 4-5 hours) that gets started by cron when all the data it works with becomes available. Sometimes, when I am waiting for it to finish, ...
21
votes
2answers
7k views

How to stop xargs from badly merging output from multiple processes?

I'm using xargs with the option --max-args=0 (alternatively -P 0). However, the output of the processes is merged into the stdout stream without regard for proper line separation. So I'll often end ...
21
votes
1answer
53k views

bash: Avoid getting PID of parent process if subprocess fails [duplicate]

(Former Title - bash: Run command in background and capture pid) NOTE This is not a [DUPLICATE] of the other question since it addresses the unexpected behavior of bash where a failure of the ...
20
votes
5answers
10k views

How do I get only the PID, without any extra information, of a process running on port 3000?

I'm using CentOS 7. I want to get the PID (if one exists) of the process running on port 3000. I would like to get this PID for the purposes of saving it to a variable in a shell script. So far I ...
20
votes
3answers
125k views

How to get the Job ID? [duplicate]

As we know, the shell enables the user to run background processes using & at the command line's end. Each background process is identified by a job ID and, of course, by it's PID. When I'm ...
20
votes
4answers
44k views

How to kill a process with a single command?

I want to kill a process, after finding the id in a single step. I currently use these two commands: pidof <name> kill <#number_which_is_result_of_command> How can I write a single ...
20
votes
2answers
31k views

lsof for a specific process?

There's a bzip2 process running in the background and I have no idea where it came from. It's eating up a lot of resources. Can I do a reverse lsof to see which files are being accessed by this ...
20
votes
4answers
118k views

Please explain this output of ps -ef command?

A part of the output from the ps -ef command is given below : UID PID PPID C STIME TTY TIME CMD root 1 0 0 2012 ? 00:00:01 init [3] root 2 ...
19
votes
8answers
190k views

Kill only one Java process

I usually run few Java applications, one for server running locally and other for some IDE like NetBeans. And from time to time, after lots of redeployments, my server get stuck on ...
19
votes
3answers
2k views

How does a program decide whether or not to have coloured output?

When I execute a command from a terminal that prints coloured output (such as ls or gcc), the coloured output is printed. From my understanding, the process is actually outputting ANSI escape codes, ...
19
votes
1answer
3k views

ps only prints up to 4096 characters of any process's command line

When I grep for a java process I get below output but it's limited to 4096 characters which results to actual process name(which is kafka.Kafka) not shown in grep output. Is this a limitation of grep?...
19
votes
2answers
10k views

How is /proc/self implemented in Linux?

I was tinkering around with the /proc filesystem in Linux, and I came across /proc/self, which is a symbolic link to the process directory of the current process. I would like to know how it is ...
19
votes
2answers
52k views

Kill a process that keeps restarting

What if 'kill -9' does not work? or How to kill a script which starts new processes? doesn't help me in anyway. I have a python script which starts automatically with another process id using ...
19
votes
2answers
5k views

Any issue if Zombie state is not cleared?

I have production unit in which java process has become Zombie and remained there for some time now. If the unit is restarted, then it will be cleared. However, the unit is not restarted and another ...
19
votes
3answers
62k views

Terminating a bash shell script running in the background

I often use bash shell scripts to run simple commands for many different files. For example, suppose that I have the following bash shell script, called script.sh, that runs the program/command foo ...
19
votes
1answer
5k views

How to change Linux context-switch frequency?

How is it possible to change the Linux (linaro, ubuntu, debian) context-switch frequency? I am okay for trading-off a less-responsive system for a more efficient one. EDIT1: I have a main process ...
19
votes
1answer
5k views

Why do I need dbus?

I recently removed dbus from my system (along with consolekit and polkit). I didn't notice any change (I was running it as system daemon and per-user from .xinitrc). However, many people claim that ...
18
votes
3answers
6k views

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 ...
18
votes
4answers
76k views

Finding the ID of a process and killing it

When ever I need to kill a background process I do ps -e | grep <process_name> Which prints something like this 1766 ? 00:00:13 conky , Then I use the process ID to kill it like so kill 1766 . ...
18
votes
7answers
8k views

What is using this network socket?

I'm trying to use NTP to update the time on my machine. However, it gives me an error: host # ntpdate ntp1.example.org 10 Aug 12:38:50 ntpdate[7696]: the NTP socket is in use, exiting What does the ...
18
votes
4answers
14k views

Listen for exit of process given pid $$

Say I have a pid in hand, mypid=$$ is there some bash/system command I can use to listen for the exit of that process with the given pid? If no process with mypid exists, I guess the command should ...
18
votes
3answers
37k views

Bash script to find and kill a process with certain arguments?

I want a script which kills the instance(s) of ssh which are run with the -D argument (setting up a local proxy). Manually, I do ps -A | grep -i ssh, look for the instance(s) with -D, and kill -9 {id}...
18
votes
1answer
28k views

Is it possible to get process group ID from /proc?

In "https://stackoverflow.com/questions/13038143/how-to-get-pids-in-one-process-group-in-linux-os" I see all answers mentioning ps and none mentioning /proc. "ps" seems to be not very portable (...
18
votes
4answers
22k views

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 ...
18
votes
1answer
1k views

Process which locks up, ignores SIGKILL, is runnable (not a zombie or in uninterruptable sleep). What state is it in?

I have a process which several times now has stopped responding and appears to be completely locking up. It doesn't respond to any attempt at strace or peeking with gdb (gdb just hangs on a wait4() ...
17
votes
1answer
2k views

Process states in OS theory vs in Linux

I'm trying to map Linux process state codes (as in ps) to states in the OS state diagram but I can't seem to map them. Is it because Linux process states don't necessarily match the theoretical OS ...
17
votes
3answers
31k views

How do I find the resident memory size of a process on busybox?

I run top on busybox and it shows all processes and their virtual memory size. How do I determine how much RAM is being used by each process?
17
votes
1answer
29k views

fork() and how signals are delivered to processes

I program that I wrote in C fork()'s off a child process. Neither process will terminate. If I launch the program from the command line and press control-c which process(es) will receive the interrupt ...
17
votes
2answers
17k views

Why does bash show 'Terminated' after killing a process?

Here is the behaviour I want to understand: $ ps PID TTY TIME CMD 392 ttys000 0:00.20 -bash 4268 ttys000 0:00.00 xargs $ kill 4268 $ ps PID TTY TIME CMD 392 ttys000 ...
17
votes
2answers
1k views

How are the processes in UNIX numbered?

I can't find any pattern when I look at the numbering of PIDs in process table (ps -a), as the PIDs are not subsequent numbers and sometimes there are large "gaps" between those numbers. Is it ...
17
votes
4answers
22k views

Run linux process at very very low priority?

I have regular process that not so important but will consume so much CPU power, and I have another process which is really important, but it spend most of the time idle, but when it got a job it ...
17
votes
1answer
622 views

Why does “$$” not change in a bash pipeline? Don't they start subprocesses?

I ran following code : echo $$ # Output : 3911 true | while true; do eval 'echo $$' break done # Output : 3911 The documentation says that while loop (involved in pipe) runs in a subprocess, ...
17
votes
3answers
42k views

Find out the total memory allocated for a particular process in Ubuntu

How can I find out the total memory allocated for a particular process in Ubuntu?
17
votes
3answers
4k views

Is there an upper limit to the number of zombie processes you can have?

I used to work with an HP-UX system and the old admin told me there is an upper limit on the number of zombie processes you can have on the system, I believe 1024. Is this a hard fact ceiling? I ...
17
votes
3answers
9k views

Simulate an unkillable process in D state

For catastrophe testing scenarios on out server environment we're looking for an easy way to make a process stuck in D (uninterruptible sleep) state. Any easy ways? An example C sample code would be ...
16
votes
5answers
2k views

How can I control a shell script from outside while it is sleeping?

I am fairly new to shell scripting. I have a script similar to the following, while [ true ] do sleep 5m # PART X: code that executes every 5 mins done While this is running (1) how can I ...
16
votes
2answers
8k views

How can I get the pid of a subshell?

How can I get the pid of a subshell? For example: $ echo $$ 16808 This doesn't work, because the original shell expands $$: $ ( echo $$ ) 16808 Why does single quoting not work? After the ...
16
votes
3answers
7k views

Can I limit a process to a certain amount of time / CPU cycles?

We have a script which runs on our web servers, triggered by customer action, which initiates a unix process to generate some cache files. Because this process acts upon files supplied by our customer,...
16
votes
2answers
8k views

How should I check whether a given PID is running?

I'm writing a Perl script that parses logfiles to collect PIDs and then checks whether that PID is running. I am trying to think of the best way to make that check. Obviously, I could do something ...

1 2 3
4
5
48