• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

atq Command Examples in Linux

by admin

The at command is used to run a task once, at a specified time. It is not designed for repetitive or regularly scheduled tasks. The at command is very flexible. Users can specify a particular date and time, or cause the scheduled command to run after a given period of time. The command is typically used in an interactive manner, where the at command and time interval are specified, then a task is defined in an interactive prompt. This enables the user to enter a path to a script or a command to be run. Pressing Ctrl+D exits the interactive mode.

Listing scheduled tasks

Sometimes, it happens that a task has been scheduled to run at a specific time, but we forget the time at which a task is supposed to run. We can see the already scheduled tasks using one of the atq or the at command with the -l option:

$ atq
33      Mon Sep 21 14:00:00 2015 a geek
42      Sun Sep 27 16:00:00 2015 a geek

The atq command displays jobs scheduled by the current user with the job number, time, and user’s name:

$ sudo atq
34      Mon Sep 21 04:00:00 2015 a root
33      Mon Sep 21 14:00:00 2015 a geek
42      Sun Sep 27 16:00:00 2015 a geek

Running atq with sudo, lists jobs scheduled by all users.

atq Command Options

1. Show the current user’s scheduled jobs:

# atq

2. Show jobs from queue named ‘a’ (queues have single-character names):

# atq -q a

3. Show jobs of all users (run as superuser):

# sudo atq

Filed Under: Linux

Some more articles you might also be interested in …

  1. dar Command Examples in Linux
  2. CentOS / RHEL 5 : dm-multipath file /etc/sysconfig/mkinitrd/multipath explained
  3. How To Add Standard Linux Users To Manage Print Jobs And Services in CentOS/RHEL
  4. CentOS / RHEL 6,7 : How to disable or delete virbr0 interface
  5. How to recover GRUB (Corrupted boot partition) in CentOS/RHEL 5,6
  6. cut: command not found
  7. 6 Useful journalctl Command Examples in CentOS / RHEL 7 (Cheat Sheet)
  8. resize2fs: commnd not found
  9. Linux OS Service ‘avahi-daemon’
  10. ledctl Command Examples in Linux

You May Also Like

Primary Sidebar

Recent Posts

  • powertop Command Examples in Linux
  • powertop: command not found
  • powerstat: command not found
  • powerstat Command Examples in Linux

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright