General :: Finding A Cmd That Will Kill All Processes That Are Accessing A Specific Filename?
Dec 16, 2009
I thought 'killall' would work, but I need to provide the "command" to kill. I'm really looking for a command that will kill all processes that have a particular file/directory open. Currently, my script fails on an 'umount' because there are several processes that have this filesystem open. The command 'lsof' is a good tool to determine which processes have a filesystem open, but I don't really want to write a script that parses through the 'lsof' output to capture PSIDs. Is there a linux command that can kill all processes that may have a particular filesystem open?
View 2 Replies
ADVERTISEMENT
Jul 28, 2011
How to kill the processes accessing Internet in background using terminal commands.Command to stop (disconnect) the processes accessing Internet.Command to kill the process accessing Internet.
View 1 Replies
View Related
Dec 14, 2010
if i do a
ps aux | grep ftp
that would show me at least any active ftp connects started with the ftp command, right? Is there then a way to use that to somehow kill any stuck sessions that are older than an hour?
View 9 Replies
View Related
Oct 28, 2010
I am developing a daemon that is acting up and I am now unable to create any new processes (ie. I cannot start a new process to kill the other rogue processes). So, I need to be able to kill the processes from a remote machine. How do I do "kill" remotely without admin privileges? If I cannot kill my own process from a remote machine as a normal user then tell me so I can mark it as the correct answer.
View 3 Replies
View Related
Aug 26, 2009
I've run into what is apparently an age-old SSH problem, which is that killing an ssh client process does not kill the remote process (unlike e.g. rsh). There seem to be lots of patches and a couple of open bugs on this topic that have been there for about 10 years or so... Having convinced myself by googling that there is no easy solution, I'm now looking for a workaround of some sort. I'm writing a testing framework so the processes I'm running remotely could be anything at all, i.e. I only have control of the client side. Also the remote processes are of course highly unstable and I need to be able to terminate them if they hang. ssh -t won't work for me as I don't necessarily have a terminal. Finding the remote process ID would be enough so I can do ssh <machine> kill <pid>, but I don't see any way to do that either. Just using ps, pgrep etc seems to suffer from not being able to uniquely identify the correct process, and killing the wrong process is of course very bad.
View 14 Replies
View Related
Nov 18, 2010
All the kill idle user processes scripts I've seen don't take into account that the user might have multiple sessions open. Such is the case with one of our clients. Currently, every hour or two I need to do the following:
This will get the TTY and idle time for all users.
For each idle time over a half hour, I do the following (TTY is the TTY from the previous command with a space.
I then kill those processes.
There must be a way to do this automatically in a bash or perl script. I've tried both, but can't seem to get things to work properly.
View 2 Replies
View Related
Aug 3, 2010
i was referring to an article given in following website.[URL] I was surprise to know that i can kill all running processes by using kill 0. However when i tried running the command nothing happened.
my machine details:
Code:
# lsb_release -a
LSB Version: :core-3.1-ia32:core-3.1-noarch:graphics-3.1-ia32:graphics-3.1-noarch
Distributor ID: EnterpriseEnterpriseServer
Description: Enterprise Linux Enterprise Linux Server release 5.2 (Carthage)
Release: 5.2
Codename: Carthage
View 4 Replies
View Related
Aug 14, 2009
I'm attempting to use 'killall' to kill all mysql processes, however after using the command mysql processes are still alive. 'killall mysql' says no processes were killed, and while 'killall mysql_safe' gives no message there are still mysql processes alive afterwards.
Code:
# killall mysql
mysql: no process killed
# killall mysqld_safe
[code].....
View 3 Replies
View Related
May 3, 2010
I don't know about your computer but when mine is working properly no process is sucking 95%+ over time. I would like to have some failsafe that kills any processes behaving like that. This comes to mind because when I woke up this morning my laptop had been crunching all night long on a stray chromium child process.
This can probably be done as a cron job, but before I make it a full time job creating something like this I'd thought I should check here. :) I hate reinventing the wheel.
View 1 Replies
View Related
Feb 11, 2011
I issue the command ps -aux | grep tony. It displays the following output
tony 10986 0.0 0.0 33532 464 ? S Feb01 0:00 vncconfig -iconic
tony 10988 0.0 0.0 86012 512 ? S Feb01 0:00 twm
tony 15553 0.0 0.0 92404 1848 ? S 10:34 0:00 sshd: tony@pts/34
[code]....
View 3 Replies
View Related
Oct 19, 2010
I am trying to write a script which when executed should kill all currently running cat processes.
View 1 Replies
View Related
Jun 18, 2010
How to tell the kill command to ignore processes if that process is not alive?
For example: 3453 is an alive process but 44534 is not.
kill -9 3453 44534
View 4 Replies
View Related
Apr 28, 2011
how do I detect and kill zombie processes left from the command line of a Linux terminal?
View 3 Replies
View Related
Jul 31, 2010
how to kill all Programs on a specific X display? In example, I need to kill all Programs on Display :1. How is this possible?
View 2 Replies
View Related
Feb 11, 2011
I have a command that outputs as follows:
# lostjobs
user1 12983 1 0 Feb04 ? 00:00:00 dbr UT:msmenu
user1 18253 1 0 Feb09 ? 00:00:00 dbr UT:msmenu
[code]....
I know I can grab the ones with what I want to kill (which are the ones with question marks) with:
# lostjobs | grep ?
what I need to know is how can I loop through the results of the second one and kill them by id (the second column).
View 2 Replies
View Related
Dec 11, 2010
how can i find on a linux system the processes that are using 8080 port (ex a web server)
View 2 Replies
View Related
Aug 22, 2011
All of a sudden, my computer feels sluggish. Mouse moves but windows take ages to open, etc. uptime says the load is 7.69 and raising. What is the fastest way to find out which process(es) are the cause of the load? Now, "top" and similar tools isn't the answer because they either show CPU or memory usage but not both at the same time. What I need is the single command which I might be able to type as it happens - something that will figure out any of: "System is trying to swap 8GB of RAM to disk because process X ..." or "process X seeks all over the disk" or "process X uses 400% CPU"
So what I'm looking for is iostat, htop/atop and similar tools run into one with an output like this:
1235 cp - Disk trashing
87 chrome - Uses 2GB of RAM
137 nfs_bench - Uses 95% of the network bandwidth
I don't want a tool that gives me some numbers which I can analyze but a tool that tells me exactly which process causes the current load. Assume that the user in front of the keyboard barely knows how to write "process" but is quickly overwhelmed when it comes to "resident size", "virtual memory" or "process life cycle".
My argument goes like this: User notices problem. There can be thousands of reasons ... well, almost. User wants to know source of problem. The current solutions give me lots of numbers and I need to know what these numbers mean. What I'm looking for is a meta tool. 99% of the data is irrelevant to the problem. So what the tool should do is look for processes which hog some resource and list only those along with "this process needs a lot of CPU, this produces many IRQs, this process allocates a lot of RAM (and it's still growing)".
This will be a relatively short list. It will be much more simple for an newbie to locate the culprit from this list than from the output of, say, htop which gives me about 5000 numbers but requires me to fold multi-threaded processes myself (I have 50 lines which say VIRT 2750M but only 16GB of RAM - the machine ought to swap itself to death but of course, this is a misinterpretation of the data that can happen quickly).
View 5 Replies
View Related
Nov 17, 2010
I want to check all the child processes attached to a specific process. Say for a example; my process is a java process. Then I wanna know what are the processes attached to that java process. At the moment I use the command # ps aux|grep java; this gives the details about the currently running java process. So I can kill the whole java process using #kill -9 {pid} ...but there are sub processes attached (I guess child processes) to java process. I wanna view all of them & kill whatever the process I like not the whole thing. I'm using Red hat 5 enterprise edition. and currently a weblogic application server is running on that.
View 2 Replies
View Related
Apr 12, 2011
Is there a command to check specific processes that's using the most IO/disk usage? I know sar and ps but I want more specific details on IO on individual processes
View 5 Replies
View Related
Sep 22, 2010
I have an issue on one of my servers whereby the [normally very helpful] du and tar programs are somehow using up too much or my system resources (du 40% mem, tar 20% mem) and causing problems. I am after a command which is able to kill a process without knowledge of a PID but by process name e.g. "du" and memory usage e.g. >= 10%.
Something along the lines of:
kill $(pgrep du) grep %MEM > 10
Although I know that is invalid syntax I cannot fathom the correct/best way to achieve this end!
View 9 Replies
View Related
Dec 3, 2010
I have my code with my fork in a server and each time a client connects one more process is created. i use this code for the handling of zombies
void sig_chld(int signo){//Diadikasia gia tin diagrafi twn 'zombies'
signal( SIGCHLD, sig_chld );//signal gia ton entopismo tou zombie
pid_t pid;
[code]....
but i need the server to kill each zombie after the client is disconnecting and not to have to press ctrl+c
View 1 Replies
View Related
Nov 18, 2010
how to even start this Perl script. I have the following processes:
Command used to get this info:
ps aux --forest | grep -e process_name -e ksh | awk '{if ($1 == "user1" && $1 != "root" && $1 != "UID" && $1 != "xfs" && $1 != "mfg" && $1 != "mfgnet") print $0}'
Processes
user1 2819 0.0 0.0 4272 612 ? S Nov17 0:00 \_ -pksh-ksh
user1 2820 0.0 0.0 64956 1584 pts/833 Ss+ Nov17 0:00 \_ -ksh
[code]....
I need a way to kill off the pids 2819, 2820 because they do not have a process tied to them like pids 2918, 2922 and 6657. The way it works is peek shell (pid 2918)is opened then it starts a ksh (pid 2922) session then from there the end user runs a command (pid 6657).
View 7 Replies
View Related
Dec 15, 2010
I'm trying to avoid kill -9 for the reasons described in the Useless Use of Kill -9 form letter. Is this function sufficient, or do I need to kill the kill processes after a timeout or take care of other subtleties?
soft_kill()
{
# Try to avoid forcing a kill
# @param $1: PID
kill $1 || kill -INT $1 || kill -HUP $1 ||
(echo "Could not kill $1" >&2; kill -KILL $1)
}
As an aside, what's a better name for this function? The current name reminds me of "Killing Me Softly", and manslaughter sounds a bit severe. Maybe spoon_kill (Google it)?
View 2 Replies
View Related
Jun 15, 2010
I'm working with Eclipse and it's starting to misbehave now and then which completely freezes my computer. Is there any emergency command to kill such a misbehaving process so I don't have to reboot my computer?
I already have a emergency xkill icon in my taskbar and a [Ctrl]+[F1] console with "> sudo killall eclipse" pretyped(!) but sometimes it's even to late for this. What I would need is a emergency command/console that gets a guaranteed amount of process time so I can kill these process.
View 4 Replies
View Related
Oct 21, 2010
User 1 and User 2 each start a mono process with sudo:
"sudo mono user1.exe" "sudo mono user2.exe"
Each user has a kill.sh in their directory, which is being called by user1.exe/user2.exe to kill the process.
The script itself is
ps aux | grep 'mono user1.exe' | awk '{print $1}' | xargs kill
which in theory should pull *only* the PID of "mono user1.exe" and kill only that. The problem: It kills any and every single instance of mono that is running on my system, every userx.exe thats open. I am confused, as a simple "ps aux | grep 'mono user1.exe'" does only return the mono user1.exe process and not the others. "ps aux | grep 'mono'" returns them all though. how I can modify that script so that it only kills the specific process? Would "pkill -9 -f 'mono MCuser1.exe'" work as well - or would it too kill every instance of mono? I cant do a lot more of trial and error, its not good I am killing those instances accidently...
View 14 Replies
View Related
Apr 12, 2011
i want to remove a path, but is in use.. How can i kill the zombie processes?
[Code]....
I guess i was wrong deleting first the disks that formed the path, but now how could i kill those zombie processes without a reboot?
[Code]....
View 2 Replies
View Related
Oct 15, 2009
If there is a command I can use to find specific file types? Say if I want to find all the jpg's in my home folder, but they don't have the .jpg extension in the name, how would I do it? Or can I set some kind of size parameter to find them? The ones I want are all from my digicam and roughly the same size.
View 7 Replies
View Related
May 21, 2011
I need a command to find the all files which filename contains the text "SomeText" and to delete that files!From /home/movie/wp-content/uploads/this folder I have lots of files and folders .Also I need that for folders and subfolders who contains some text in folder name "someTextInFolderName"
View 13 Replies
View Related
Sep 5, 2010
I am trying to clean up a collection of music files, often in windows i receive errors on the collection because some of the files have a "?" question mark in the file name, in windows this is not a valid character for file names. How can i search/find files with a question mark in the name? Each time i try to search for "?" i receive a list of items that match a wildcard search where ? is a wildcard. I want to find file names that actually contain the character "?".
View 2 Replies
View Related
Jan 23, 2011
$ uname -a
Linux a 2.6.35.10-74.fc14.i686.PAE #1 SMP Thu Dec 23 16:10:47 UTC 2010 i686 i686 i386 GNU/Linux
$ lsb_release -a
LSB Version: :core-4.0-ia32:core-4.0-noarch
[Code].....
How can I set a pattern that will output a filename equal to the original filename? E.g.
something.mp3 → something.ogg
And why isn't this implemented in SoundConverter?
PS: {Filename} doesn't work.
View 1 Replies
View Related