Quick calendar views and simple date tricks from the shell 25.02.2026 | reading time: 2 min Open a terminal and inspect dates fast with `cal` to show a month calendar at a glance and to query months or years from the shell Try a concrete example Run `cal` to show the current month and run `cal 6 2024` to view June 2024 for example ` June 2024 Su Mo Tu We Th Fr Sa 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30` Handy options to remember Use `cal -3` to see previous current and next months and use `cal -y` to print an entire year and use `cal -j` to display Julian day numbers and remember that the first day of week follows the system locale Automate with scripts Pipe `cal` into text tools to extract values for scripts for example to get the last day of a month use `cal 2 2024 | awk 'NF{D=$NF}END{print D}'` and then use that value in further shell logic Related commands nearby Use `ncal` for an alternative layout and `date` for timestamps and arithmetic and consider `calcurse` for a full terminal calendar and organizer when a simple calendar view is not enough Finish and next steps Start using `cal` for quick checks then combine it with `date` and small scripts to automate date checks and if the reader wants to dive deeper consider pursuing CompTIA Linux+ or LPIC-1 certification and use bitsandbytes.academy for intensive exam preparation Join Bits & Bytes Academy First class LINUX exam preparation. utilities scripting