0

I want to grep a file with the following date format:

Thu Apr 24

At the moment I only have date +"%d %m %Y" and that's returning 24 04 2014.

How do I format to get "Thu Apr 24"?

So I need the day month and date?

2
  • 1
    man date might help. Commented Apr 24, 2014 at 8:38
  • If the mentioned string isn't a part of the filename, but a timestamp then there are better ways. Commented Apr 24, 2014 at 8:38

2 Answers 2

3

man date would suggest date +"%a %b %d"

Sign up to request clarification or add additional context in comments.

Comments

3

You can try

date +"%a %b %d"

where

   %a     locale's abbreviated weekday name (e.g., Sun)

   %b     locale's abbreviated month name (e.g., Jan)

   %d     day of month (e.g., 01)

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.