pondelok 10. mája 2021

command date

 I would like to show you command date. Let's play with date:




1) classic date command


[root@localhost ~]# date

Mon May 10 09:56:56 CEST 2021

[root@localhost ~]#



-- you see date, time, time zone, year


2) date in UTC time


[root@localhost ~]# date -u

Mon May 10 07:57:52 UTC 2021

[root@localhost ~]#


3) only date


[root@localhost ~]# date -I

2021-05-10



4) we can check past dates 



[root@localhost ~]# date --date="764 days ago"

Sun Apr  7 09:59:55 CEST 2019

[root@localhost ~]#



5) we can check uptime and date to past:


[root@Bonifac ~]# uptime

 10:00:23 up 221 days, 14:38,  1 user,  load average: 0.08, 0.06, 0.12

[root@Bonifac ~]#


[root@Bonifac ~]# date --date="221 days ago"

Thu Oct  1 10:00:52 CEST 2020


--there is only date (without time)


[root@localhost ~]# date --date="221 days ago" -I

2020-10-01

[root@localhost ~]#




Thank you for this article:

https://www.linuxtechi.com/linux-date-command-with-examples/


date command in slovak blog: https://zapiskylinuxadmina.blogspot.com/2020/03/date-par-prepinacov.html

1 komentár:



  1. Thanks for sharing this.,
    Leanpitch provides crash course in Servant Leadership ,everyone can use it wisely.
    scrum master servant leadership
    What is servant leadership

    OdpovedaťOdstrániť