Hot answers tagged

116

Zombies are DEAD processes. They can not be 'kill' (You cannot kill the DEAD). All processes eventually die, and when they do they become zombies. They consume almost no resources, which is to be expected because they are dead! The reason for zombies is so the zombie's parent (process) can retrieve the zombie's exit status and resource usage statistics. ...


97

I've recently come to like setsid. It starts off looking like you're just running something from the terminal but you can disconnect (close the terminal) and it just keeps going. This is because the command actually forks out and while the input comes through to the current terminal, it's owned by a completely different parent (that remains alive after you ...


75

To kill all the processes that you have the permission to kill, simply run the command kill -15 -1 or kill -9 -1 depending on the desired behavior (use man kill for details) To kill a specific process, say, firefox, simply run pkill firefox or killall firefox depending on the behavior you want: What's the difference between 'killall' and ...


64

System Monitor shows you an overview of running applications (under the Processes tab) and allows you to end them by right-clicking on the name and selecting the respective context menu item. You can set up keyboard shortcuts in the Keyboard settings (Shortcuts tab), so you can bind Ctrl+Alt+Del to gnome-system-monitor, the command to start System Monitor. ...


61

Processes can ignore some signals. If you send SIGKILL it will not be able to ignore it (and neither catch it to do cleanups). Try: kill -9 {PID} Learn more by reading the manual page: man kill


54

Not quite. The file is already open by the program. Deleting the file ( and then replacing it with another version ) does not affect the running program because the original file is held open ( though without a name on disk to open it again ) until the program is done with it. Only when all handles to the file are closed are its data blocks on disk ...


52

Daemons - Daemon does not stand for Disk and Execution Monitor (http://www.takeourword.com/TOW146/page4.html). They are the processes which run in the background and are not interactive. They have no controlling terminal. They perform certain actions at predefined times or in response to certain events. In *NIX, the names of daemons end in d. Services - ...


51

There is an even simpler solution than the one of qbi: killall let's you kill processes by name, and you can specify signals. killall -9 middleman See man killall for more information and extra options (there are quite a few). As the name suggests, this does send the signal to all processes named middleman. But that's not different from other ways (like ...


51

You can send vim the SIGTSTP signal. You do this by pressing ctrl+z. Vim will get suspended in the background, and you can use the terminal. Type fg in the terminal to resume with vim. Bonus tip: This works on nearly all terminal applications. Use bg to enable the application to continue running in the background.


47

A bash script to do something like that would look something like this: #!/bin/bash # Check if gedit is running if pgrep "gedit" > /dev/null then echo "Running" else echo "Stopped" fi This script is just checking to see if the program "gedit" is running.


44

I think you see killall in how-to's because by default it requires the precise process name, whereas pkill does basic pattern matching. Thus, killall is safer for users to blindly copy and paste. Pkill and killall both have distinguishing options. Killall has a flag to match by process age, pkill has a flag to only kill processes on a given tty. Etcetera ad ...


43

From your output we see a "defunct", which means the process has either completed its task or has been corrupted or killed, but its child processes are still running or these parent process is monitoring its child process. To kill this kind of process kill -9 PID don't work, you can try to kill with this command but it will show this again and again. ...


41

1. `killall` already nice (SIGTERM) killall by default sends SIGTERM. This is already the nice approach that leaves applications the chance to clean up after themselves. The "go die already, right now!" approach is to send a SIGKILL signal, which requires specifying that as an option to killall. From The GNU C Library: Termination Signals: Macro: int ...


40

Your computer communicates with the devices attached to it through IRQs (interrupt requests). When an interrupt comes from a device, the operating system pauses what it was doing and starts addressing that interrupt. In some situations IRQs come very very fast one after the other and the operating system cannot finish servicing one before another one ...


37

The waiting channel is the place in the Kernel where the task is currently waiting. A task has to wait for a Resource, which can be data or processing time. These two include network sockets, hardware, files, and so on; since most of them are just files, in Unix-like systems. 0: The process isn't waiting poll_schedule_timeout poll() is a system call1 used ...


35

It's called pipe. It gives the output of the first command as the input to the second command. In your case it means: The result of sudo ps -ef is fed as the input of grep processname sudo ps -ef: This lists all the processes running. Type man ps in the termial for more. grep processname So, this list of processes is fed into grep which just searches ...


33

When you call a exec family method it doesn't create a new process, instead exec replaces the current process memory and instruction set etc with the process you want to run. As an example, you want to run grep using exec. bash is a process (which has separate memory, address space). Now when you call exec(grep), exec will replace current process's memory, ...


33

Open another terminal and run ps ax | grep foo where foo is the name of the unresponsive program. This should return a line of output that looks something like this: $ ps ax | grep firefox 2222 ? S 0:00 /bin/sh /usr/lib/firefox-3.6.9/firefox 2231 ? Sl 514:36 /usr/lib/firefox-3.6.9/firefox-bin 30290 pts/2 S+ 0:00 grep ...


31

They're not processes, they're threads under one process. By default htop shows threads and in this case, is very misleading. You can alter this by going into Setup (F2), Display options and checking Hide userland threads. Press F10 when you're done.


30

I don't thing zombie process is much of a headache. A zombie process does not take up any resources. It is just that it has it's entry in the process table. A Zombie process is not an orphan process, it does have a parent. kill, skill pkill will not work since the process is already killed, just that it's entry has not been removed. Zombie process can be ...


30

In vim, just type: :!sh :! launches an external process -- in this case sh, another shell. Control will return to vim once you exit the shell. If you want to use the shell concurrently with vim, add & to the end of the sh command: :!sh&


28

You can use your shell to do this task for you: kill -9 $(pidof middleman) The shell executes the command pidof middleman first. The output of pidof(8) is the process id. So the shell substitutes the pidof-command with the process id and executes kill -9 18845 (or whatever the correct process id is).


26

'nice' refers to the priority the process gets on your CPU. This is a number in the range of -20 (highest priority) to 19 (lowest). You'll probably find that most applications you're running are at nice '0', which means that they are running with normal priority and none will get preferential treatment by the scheduler over another. If you're running an ...


26

Each process in linux has a special directory /proc/{pid}/fd/. 0 is stdin, 1 is stdout and 2 is stderr. So, assuming you are only interested in diagnostic output you can determine the process pid, and then in the terminal do: to see stdout: cat /proc/{pid of process}/fd/1 to see stderr: cat /proc/{pid of process}/fd/2


25

Here's the two ways I'd go with. Firstly, not running it from a terminal; hit Alt+F2 to open the run dialog, and run it from there (without &). From a terminal, run nm-applet & But do NOT close the terminal yourself. That is, do not hit the X-button to close, and do not use File -> Exit from its menubar. If you close the terminal that way, it ...


25

I use Chromium not Chrome so they could be different, but try unchecking Background Apps: (*) Continue running background apps when Chromium is closed which is located at chrome://settings/advanced (or in settings:under the hood via the menus) down at the bottom of the page, as shown in this screenshot: Good luck!


24

There are two primary ways to identify hung processes. One is via the System Monitor GUI and the other is via top in command-line. System Monitor This can be found in System > Administration You can also create a keyboard shortcut for this in this article. Once the GUI launches you can select the Processes tab which will list all the running processes. ...


23

Per your request on the other question, here is my answer again: I'm sure there is a cleaner way of doing it, but for your second question you can try this: xprop _NET_WM_PID | sed 's/_NET_WM_PID(CARDINAL) = //' | ps `cat` This will make your cursor a cross with which you can click on an open window. It will report the PID and command in the ...


23

If you want to kill all processes that are named java you can use following command: killall -9 java This command sends signals to processes identified by their name.


20

A daemon is a background, non-interactive program. It is detached from the keyboard and display of any interactive user. The word daemon for denoting a background program is from the Unix culture; it is not universal. A server is a program which responds to requests from other programs over some inter-process communication mechanism (usually over a ...



Only top voted, non community-wiki answers of a minimum length are eligible