在 Ubuntu 系統中,你可以使用以下命令來查看當前用戶的 crontab 任務:
crontab -l
如果你想查看其他用戶的 crontab 任務,你需要具有 root 權限。作為 root 用戶,你可以使用以下命令:
sudo crontab -l -u username
將 username
替換為你要查看的用戶名。
此外,你還可以查看系統級的 crontab 文件,這些文件通常位于 /etc/crontab
和 /etc/cron.d/
目錄下。使用以下命令查看 /etc/crontab
文件:
cat /etc/crontab
要查看 /etc/cron.d/
目錄下的文件,請使用以下命令:
ls /etc/cron.d/
然后,你可以使用 cat
命令查看這些文件的內容,例如:
sudo cat /etc/cron.d/somefile
將 somefile
替換為你要查看的文件名。