Exploring date command and its different options

Exploring date command and its different options

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”.

No alt text provided for this image
No alt text provided for this image
No alt text provided for this image

Here are some commands which I have tried?:

  1. date : It is used to display the current date, time and year in your in Linux system.

No alt text provided for this image

2. date +%A : It used to display the weekday in full words.

No alt text provided for this image

3. date +%d : It is used to display number of date .

No alt text provided for this image

4. date +%m : It is used to display number of month .

No alt text provided for this image

5. date +%Y : It is used to display number of year .

No alt text provided for this image

6. date -d "tomorrow" : It is used to display tomorrow date .

No alt text provided for this image

7. date --d "yesterday" : It is used to display yesterday date .

No alt text provided for this image

8. date | cal : It is used to display today date in calendar .

No alt text provided for this image

9. date +%u :- It is used to display number of day of week .

No alt text provided for this image

10. date +%j : It is used to display number of day of year .

No alt text provided for this image



Thank-You?:-)

Hope you find this article helpful .

  • Share it with your friends !




要查看或添加评论,请登录

Amit Sharma的更多文章

社区洞察

其他会员也浏览了