列出并终止 UNIX 上的作业
我在 Solaris 10 上使用 at
命令创建了一个作业。
它现在正在运行,但我想终止它,但我不知道如何找到作业编号以及如何终止该作业或进程。
I have created a job with the at
command on Solaris 10.
It's working now but I want to kill it but I don't know how I can find the job number and how to kill that job or process.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
您应该能够使用
ps
变体找到您的命令,例如:然后,一旦找到,使用
kill
终止进程应该是一件简单的事情(权限允许) 。如果您要删除
at
队列中的作业(尚未运行),您可以使用atq
列出它们,然后使用atrm< /code> 来摆脱它们。
You should be able to find your command with a
ps
variant like:Then, once located, it should be a simple matter to use
kill
to kill the process (permissions permitting).If you're talking about getting rid of jobs in the
at
queue (that aren't running yet), you can useatq
to list them andatrm
to get rid of them.要删除尚未运行的作业,您需要使用
atrm
命令。您可以使用atq
命令获取at列表中的编号。要终止已经开始运行的作业,您需要使用 grep 来查找它,
然后使用
kill
来停止它。在大多数系统上执行此操作的更快方法是:
To delete a job which has not yet run, you need the
atrm
command. You can useatq
command to get its number in the at list.To kill a job which has already started to run, you'll need to grep for it using:
and then use
kill
to stop it.A quicker way to do this on most systems is:
at -l
列出作业,它给出如下返回:atrm 10
Kills job 10或者我的系统管理员告诉我,它
at -l
to list jobs, which gives return like this:atrm 10
kills job 10Or so my sysadmin told me, and it
首先
列出所有进程。记下您要杀死的进程号。然后
将 1234 替换为您想要的进程号。
或者,如果您绝对确定只有一个具有特定名称的进程,或者您想要终止多个共享相同名称的进程
First
to list all processes. Note the the process number of the one you want to kill. Then
were you replace 1234 with the process number that you want.
Alternatively, if you are absolutely certain that there is only one process with a particular name, or you want to kill multiple processes which share the same name