doc: update command/atq.md

This commit is contained in:
jaywcjlove 2024-12-21 19:18:27 +08:00
parent 0ae1a1bc6e
commit b1272c9afb
1 changed files with 32 additions and 6 deletions

View File

@ -7,30 +7,56 @@ atq
**atq命令** 显示系统中待执行的任务列表也就是列出当前用户的at任务列表。
### 语法
### 语法
```shell
atq [-V] [-q 队列] [-v]
```
### 选项
### 选项
```shell
-V显示版本号
-q查询指定队列的任务。
```
### 实例
### 示例
创建一个在10分钟后执行的任务并列出当前用户的任务列表
```shell
at now + 10 minutes
[root@localhost ~]# at now + 10 minutes
at> echo 1111
at> <eot>
at> <EOT>
job 3 at Fri Apr 26 12:56:00 2013
```
atq
使用`atq`命令查看当前用户的任务列表:
```shell
[root@localhost ~]# atq
3 Fri Apr 26 12:56:00 2013 a root
```
查询指定队列的任务:
```shell
[root@localhost ~]# at -q a now + 10 minutes
at> echo "Task in queue a"
at> <EOT>
job 4 at Fri Apr 26 13:06:00 2013
```
使用`atq`命令查看队列`a`中的任务:
```shell
[root@localhost ~]# atq -q a
4 Fri Apr 26 13:06:00 2013 a root
```
显示`atq`命令的版本号:
```shell
[root@localhost ~]# atq -V
atq (GNU at) 3.1.20
```