1

Exactly as it says. What code should I use to make an alias to show me only the date, and not the time also?

1 Answer 1

4
alias dateonly="date +%D"

check man date to see all the possible % formats, there's plenty of them :) for instanc,e change %D to %F for a different date format.

2
  • 2
    %x ("locale's date representation") is often a good choice Jun 24, 2014 at 14:30
  • or even better, something that anybody understands date --rfc-3339=date totally unambiguous.
    – Hannu
    Jun 24, 2014 at 15:27

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .