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

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • VCS
  • Interview Questions
  • Database
    • 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. guake: command not found
  2. rpc.statd[PID]: Failed to create listener xprt (statd, 1, udp6) – CentOS/RHEL 6, 7
  3. pw-link Command Examples in Linux
  4. RHEL 7 – RHCSA Notes – vi/vim editor
  5. CentOS / RHEL : How to convert volume group metadata between LVM1 and LVM2
  6. lftp Command Examples in Linux
  7. UNIX / Linux : What Is a Shell? What are different Shells?
  8. virt-xml-validate Command Examples in Linux
  9. “az storage blob” Command Examples (Manage blob storage containers and objects in Azure)
  10. How to uninstall speedtest-cli package from Ubuntu

You May Also Like

Primary Sidebar

Recent Posts

  • gixy Command Examples
  • gitsome Command Examples
  • gitmoji Command Examples
  • gitlint Command Examples

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright