在 CentOS 系统中,你可以使用以下命令来查看当前用户的 crontab 任务:
crontab -l
如果你想查看其他用户的 crontab 任务,你需要具有 root 权限。使用以下命令:
sudo crontab -l -u username
将 username
替换为你要查看的用户名。
此外,你还可以查看系统级的 crontab 任务。这些任务通常位于 /etc/crontab
文件中。使用以下命令查看:
cat /etc/crontab
还可以查看 /etc/cron.d
目录下的文件,这些文件也可能包含定时任务:
ls /etc/cron.d
要查看这些文件的内容,可以使用 cat
或 less
命令,例如:
sudo cat /etc/cron.d/somefile
或者
sudo less /etc/cron.d/somefile
亿速云「云服务器」,即开即用、新一代英特尔至强铂金CPU、三副本存储NVMe SSD云盘,价格低至29元/月。点击查看>>
推荐阅读:centos crontab如何备份任务