Using atrm command in Linux

The atrm command is used to remove specified jobs in a system. These jobs are scheduled using at or batch command. The job id is passed as the argument to atrm command. To delete a job a user should have the required permission. A root user can remove any job queued in the system.

In this article, you will learn to use atrm command in Linux along with some examples.

How to use atrm command in Linux

The syntax of using atrm command in Linux is given below.

atrm [-V] jobs

Where -V is used to print the version of atrm command. Jobs are one or more jobs that you want to delete from the queue.

How to display queued jobs on a system

Before you delete a job from your system you need to identify the job that you want to delete. Using atq command will display all the jobs queued on a system for execution.

When I run atq command on my system it shows the currently queued jobs you can see them in the image below-

atq

As you can see currently there are 3 jobs is in the queue.

How to remove a queued job

To remove a queued job from your system let’s say to remove job 10 we will use the following command –

atrm 10

This will remove job number 10 from the queue you can verify this using atq command.

How to remove multiple jobs from the queue

To remove multiple jobs you need to mention the job id of each job one after another. For example to remove jobs with job ids 9 and 11 use the following command in your terminal.

atrm 9 11

For more information on this command see its man page in your terminal by executing the command –

man atrm

Conclusion

Ok that how you can remove a queued job on your system. Now if you have a query then write us in the comments below.

Leave a Comment