You can check domain expiration using whois command.
Let’s say we want to get medium.com domain expiration date. Here is a command example:
The output looks like this:
We can read line by line and find the row with a domain expiration date.
Or we could use CLI tools to get it filtered. Here is a command:
whois medium.com | grep "Expiration Date"
If you want to check it automatically and be notified when your domain is about to expire, use the domain expiration monitoring tool