Displaying crontab Files

The crontab -l command displays the contents of a crontab file much the same
way that the cat command displays the contents of other types of files. You
do not have to change the directory to /var/spool/cron/crontabs directory (where crontab
files are located) to use this command.

By default, the crontab -l command displays your own crontab file. To display crontab
files that belong to other users, you must be superuser.

How to Display a crontab File

Before You Begin

Become superuser or assume an equivalent role to display a crontab file
that belongs to root or another user.

You do not need to become superuser or assume an equivalent role
to display your own crontab file.

Display the crontab file.

$ crontab -l [username]

where username specifies the name of the user's account for which you want
to display a crontab file. Displaying another user's crontab file requires superuser privileges.

Caution - If you accidentally type the crontab command with no option, press the interrupt
character for your editor. This character allows you to quit without saving changes.
If you instead saved changes and exited the file, the existing crontab file
would be overwritten with an empty file.

Example 8-2 Displaying a crontab File

This example shows how to use the crontab -l command to display the
contents of the user's default crontab file.