列出并终止 UNIX 上的作业

发布于 2024-08-12 19:53:20 字数 101 浏览 5 评论 0原文

我在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

孤芳又自赏 2024-08-19 19:53:20

您应该能够使用 ps 变体找到您的命令,例如:

ps -ef
ps -fubob # if your job's user ID is bob.

然后,一旦找到,使用 kill 终止进程应该是一件简单的事情(权限允许) 。

如果您要删除 at 队列中的作业(尚未运行),您可以使用 atq 列出它们,然后使用 atrm< /code> 来摆脱它们。

You should be able to find your command with a ps variant like:

ps -ef
ps -fubob # if your job's user ID is bob.

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 use atq to list them and atrm to get rid of them.

嘿咻 2024-08-19 19:53:20

要删除尚未运行的作业,您需要使用 atrm 命令。您可以使用atq命令获取at列表中的编号。

要终止已经开始运行的作业,您需要使用 grep 来查找它,

ps -eaf | grep <command name>

然后使用 kill 来停止它。

在大多数系统上执行此操作的更快方法是:

pkill <command name>

To delete a job which has not yet run, you need the atrm command. You can use atq 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:

ps -eaf | grep <command name>

and then use kill to stop it.

A quicker way to do this on most systems is:

pkill <command name>
长途伴 2024-08-19 19:53:20

at -l 列出作业,它给出如下返回:

age2%> at -l
11      2014-10-21 10:11 a hoppent
10      2014-10-19 13:28 a hoppent

atrm 10 Kills job 10

或者我的系统管理员告诉我,它

at -l to list jobs, which gives return like this:

age2%> at -l
11      2014-10-21 10:11 a hoppent
10      2014-10-19 13:28 a hoppent

atrm 10 kills job 10

Or so my sysadmin told me, and it

屋檐 2024-08-19 19:53:20

首先

ps -ef

列出所有进程。记下您要杀死的进程号。然后

kill 1234

将 1234 替换为您想要的进程号。

或者,如果您绝对确定只有一个具有特定名称的进程,或者您想要终止多个共享相同名称的进程

killall processname

First

ps -ef

to list all processes. Note the the process number of the one you want to kill. Then

kill 1234

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

killall processname
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文