I am trying to display only the current time using "date", not all that information Day, Month, Year etc.. , only the current time.
i.e.:
13:45 or 1:45pm
Any ideas?
I am trying to display only the current time using "date", not all that information Day, Month, Year etc.. , only the current time.
i.e.:
13:45 or 1:45pm
Any ideas?
will show you the 24 hour time, and
will show you the time in 12 hour format.
date +%H:%I
also works.Check out the "Conversion Specifications" in the manpage for more variables to pick and choose.
Current time 24h format:
Current time 12h format with AM/PM:
for 13:45
for 01:45
will tell how long the system has been running (along with other information) check man entry for uptime
I use this:
for nanoseconds use this:
Example outputs:
last
displays info about recent logins. See http://linux.about.com/library/cmd/blcmdl1_last.htm for more info about it. I think it can show shutdowns too. For the time trydate +%r
. See http://linux.about.com/od/commands/l/blcmdl1_date.htm for more info on date.