Linux command
calendar 命令
趣味
复制后可按需替换文件名、目录或参数。
常用示例
Display today and tomorrow's reminders
calendar
Show reminders for the next N days
calendar -A [7]
Look back N days
calendar -B [3]
Use a specific calendar file
calendar -f [path/to/calendar]
Show all upcoming events
calendar -a
Display reminders for everyone
calendar -a
Use a specific calendar directory
calendar -d [path/to/calendar_dir]
说明
calendar is a traditional Unix utility that displays reminders from a calendar file. It reads entries from ~/.calendar/calendar (or a specified file) and displays those matching today's date and optionally upcoming dates. Calendar files contain one reminder per line in a simple format: a date followed by a tab and the reminder text. Dates can be specified in various formats including "Jan 1", "1/1", "*/15" (monthly), and day names. The program understands holidays and special date expressions. The tool was traditionally used for system-wide announcements and personal reminders. When run with -a by root, it processes all users' calendar files and sends email notifications. Many systems include pre-installed calendar files with historical dates, holidays, and astronomical events. Common calendar file locations include system calendars in /usr/share/calendar/ with files for holidays, history, music, and other categories. Users can include these system files in their personal calendars using #include directives.
参数
- -A _days_
- Look ahead the specified number of days (default: 1, showing today and tomorrow).
- -B _days_
- Look back the specified number of days.
- -a
- Process calendar files for all users, sending mail (root only).
- -f _file_
- Use the specified file instead of ~/.calendar/calendar.
- -d _dir_
- Use the specified directory for calendar files.
- -t _date_
- Pretend today is the specified date (format: [[ccyy]mm]dd).
- -w
- Print day of the week name.
FAQ
What is the calendar command used for?
calendar is a traditional Unix utility that displays reminders from a calendar file. It reads entries from ~/.calendar/calendar (or a specified file) and displays those matching today's date and optionally upcoming dates. Calendar files contain one reminder per line in a simple format: a date followed by a tab and the reminder text. Dates can be specified in various formats including "Jan 1", "1/1", "*/15" (monthly), and day names. The program understands holidays and special date expressions. The tool was traditionally used for system-wide announcements and personal reminders. When run with -a by root, it processes all users' calendar files and sends email notifications. Many systems include pre-installed calendar files with historical dates, holidays, and astronomical events. Common calendar file locations include system calendars in /usr/share/calendar/ with files for holidays, history, music, and other categories. Users can include these system files in their personal calendars using #include directives.
How do I run a basic calendar example?
Run `calendar` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -A _days_ do in calendar?
Look ahead the specified number of days (default: 1, showing today and tomorrow).