Exploring date command and its different options
Amit Sharma
DevOps Engineer | Proficient in Docker, Kubernetes, Jenkins, Terraform, Git-GitHub | Deep Learning Enthusiast | AWS Cloud Enthusiast | Coding in Python & C++ |
Introduction
Date command is used to display the date and time of your Linux system. It is most commonly used to print the date and time in different formats and calculates future and past dates .
This command also provides many format and options , you can find them just by running mannual command “man date”.
Here are some commands which I have tried?:
2. date +%A : It used to display the weekday in full words.
3. date +%d : It is used to display number of date .
4. date +%m : It is used to display number of month .
5. date +%Y : It is used to display number of year .
6. date -d "tomorrow" : It is used to display tomorrow date .
7. date --d "yesterday" : It is used to display yesterday date .
8. date | cal : It is used to display today date in calendar .
9. date +%u :- It is used to display number of day of week .
10. date +%j : It is used to display number of day of year .
Thank-You?:-)
Hope you find this article helpful .
--
7 个月Yes