You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

能否使用sacct --name通过作业名称前缀查询作业?

Querying Jobs by Name Prefix with sacct --name

Yes, you absolutely can query jobs using a name prefix with sacct --name—you just need to adjust how you use wildcards so Slurm, not your shell, interprets them. Here's how to fix it:

The Problem with Your Initial Attempt

When you ran sacct --name Qm*, your shell tried to expand Qm* to match files in your current directory first. If there were no matching files, it passed the literal string Qm* to sacct, which treats * as a regular character (not a wildcard). That's why you got empty results.

Solution 1: Use Quotes to Let Slurm Handle the Wildcard

Modern Slurm versions support the * wildcard in the --name parameter. The key is to wrap your pattern in quotes to prevent your shell from expanding it prematurely. For your prefix example, run:

sacct --name "Qm*"

This passes the exact Qm* pattern to sacct, which will then match any job name starting with Qm.

Solution 2: Legacy Wildcard (if * Doesn't Work)

If you're using an older Slurm version, it might use % instead of * as the wildcard character for job name matching. Try this instead:

sacct --name "Qm%"

Bonus: Match Multiple Prefixes

You can also query multiple prefixes at once by using a comma-separated list inside the quotes:

sacct --name "Qm*,Abc*,Xyz*"

Example Verification

Using your existing job name QmRsaBEGcqxQcJbBxCi1LN9iz5bDAGDWR6Hx7ZvWqgqmdR*1*0*-1.sh (where the * are part of the actual job name), the quoted Qm* pattern will correctly match this job, just like your full-name query did.

内容的提问来源于stack exchange,提问作者alper

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.28 06:58:53