Wednesday, July 2, 2014
10:15 PM

Show Date And Time On Linux Terminal / Console

daily post about simple terminal tutorial :) now learn how to show current date and time, lets check it out. launch your terminal... and type this code.

creatorb@creator-b:~$ date

when you type "date" you can get current date and time of your computer, like this... ;)

show date on terminal linux


standart print of date console, type this command
creatorb@creator-b:~$ date +"%c"

owh ya you can format the date as follows in dd-mm-yy format, type this command:

creatorb@creator-b:~$ date +"%d-%m-%y"

and when you want to know print the date of the day before yesterday, you can type command:

creatorb@creator-b:~$ date --date='13 days ago'

so you can get display time 13 days ago, and don't forget try this... like as type logic idea ;)

creatorb@creator-b:~$ date --date='13 days tomorrow'

and you can get print the current full month name and the day of the month, when type command like this...

creatorb@creator-b:~$ date '+%B %d'

and now you can get display of date like as calendar, how to get it? it's simple let's type "cal" on your terminal...

creatorb@creator-b:~$ cal

and you can see like this...

how to show calendar on terminal linux

you can try other layout format :) type this

creatorb@creator-b:~$ ncal


and you can display calender of year, example i want to show calendar for year 2014. so type this command

creatorb@creator-b:~$ cal 2014


and you can also display current year, type this

creatorb@creator-b:~$ cal -y


maybe you want to get particular month and year you can try this, i want to get august 2014 so i will type like this

creatorb@creator-b:~$ cal 8 2014

oke guys, see you next simple tutorial... keep coding and be a good programmer ;)

/ terminal tutorial by creatorbe

0 comments:

Post a Comment