English 中文(简体)
如何在cy子中杀手?
原标题:How to kill a process in cygwin?

Hi following:

“The

我在窗户Xp 32 借方位上 running。

我已尝试发布以下命令:

/bin/kill -f 4760
/bin/kill -9 5000
kill -9 5000
kill 5000

当一字书写/白/杀——f 4760先拿到电文时,就杀了: could开了4760页。

当书写/白/杀——9 5000 i 收到电文时,死亡:5000:无这种过程。

I simply don t understand why this process cant be killed. Since it has a WINID shouldnt it be killed by /bin/kill -f 4760?

希望的人能够帮助:

问题回答

The process is locked from Windows most likely. The error you are getting "couldnt open PID XXX" points to this. To confirm try killing it with windows taskkill

    taskkill /PID 4760

奇怪的是,在Cygwin开展了以下工作:

echo PID1 PID2 PID3 | xargs kill -f

例如:

ps -W | grep WindowsPooPoo | awk  {print $1}  | while read line; do echo $line | xargs kill -f; done;

不同的Windows程序将处理以下信号:<代码> 技能<>/代码>发送的信号不同;这些信号从来不是以同样的方式设计来处理这些信号的,即LC/Cygwin方案。

杀害视窗方案的唯一可靠方法是使用视窗专用工具,如任务主管或程序探索者。

尽管如此,如果你尚未到场,你可能已经以管理方式管理过你的Cygwin码头(右上点击你的短cut和选择“Run”为管理者)。

@Donal Tobin提出的方法正确:

http://www.ohchr.org。

However, I don t need to log in as administrator.

建立一个称为杀手的档案。

ps -W | grep $1 | awk  {print $1}  | while read line; do echo $line | xargs kill -f; done;

然后批准。

chmod 777 killall.sh

阁下,bash - 引言

alias killall="~/killall.sh"   (point it to the correct location)

然后,你只得打“技能[名称]”

killall.sh - Kill by process name.

#/bin/bash
ps -W | grep "$1" | awk  {print $1}  | xargs kill -f;

Usage:

$ killall <process name>

对于我来说,这一指令does not work onWindows 10 in Cygwin:

$ kill -f 15916
bash: kill: (15916) - No such process

否则,你可以使用下指挥:

$ powershell kill -f 15916
$ netstat -ano | grep  :8080  | awk  {print $5}  | xargs powershell kill -f
$ netstat -ano | grep  :8080  | awk  {print $5}  | while read pid; do powershell kill -f $pid; done;
$ netstat -ano | grep  :8080  | awk  {sub(/
/,"",$5) ; print $5}  | while read pid; do taskkill /F /PID $pid; done;
SUCCESS: The process with PID 15916 has been terminated.

I use this to kill a program in a .sh script like: taskkill /F /IM notepad++.exe /T

Or to stop and leaving cygwin: taskkill /F /IM bash.exe /T

我希望你在12年之后不再处理此事,但我认为我有一个尚未分享的答复。 您可以采取两种方式之一(即:

  • env kill -f -W <windows PID>
  • /bin/kill -f -W <windows PID>

I know there as a comment to your question similar to this, but I don t think that would ve helped unless you used the -W flag.





相关问题
cygwin file path tab completion not working

How can I set up Cygwin to have tab completion? Actually, I do have it automatically, but it does not seem to complete paths. How do I set it up to complete paths?

cygwin version of idle has erroneous I/O handling

I am using idle (python 2.5) via cygwin on a windows vista machine and when I try to open an already existing .py file I see the full file path /home/aaron/C:/cygwin/home/aaron/script.py on the ...

Trying to get a terminal to work in Emacs

I ve been having a lot of problems with emacs and trying to get the terminal to work with: M-x term I installed cygwin and I fixed up my .emacs to include the paths: (setenv "PATH" (concat "...

Piping Cygwin into a Python program

As a i m new to the whole Piping thing and Python I had recently encountered a problem trying to pipe Cygwin s stdin & stdout into a python program usin Python s subprocess moudle. for example I ...

Unable to chdir() on Git/Cygwin

I installed Git via Cygwin on Windows Server. It works out very well. However there s a small issue that when I clone a repo use the command as following: $git clone git@myserver:project.git I ...

Linux Development C/C++/bash/python on windows-7

Before resorting to stackoverflow, i have spend a lot of times looking for the solutions. I have been a linux-user/developer for few years, now shifting to windows-7. I am looking for seting-up a ...

Cygwin/Git/Gitosis unable to push new repository

I ve recently set up cygwin, git, and gitosis on my Windows Server 2003 box and am having troubles. I ve followed just about every tutorial I can find to the letter, and have confirmed that my git ...

热门标签