Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In linux how to get the date of the first day of the week monday.

I know that date +"%u" gives the current day of the week from this how to get the date of the monday of that week

share|improve this question
up vote 5 down vote accepted

The date command is very flexible about the input it will take from -d Try this


if [ $(date +%u) -eq "1" ]
   date -d "last monday"
share|improve this answer
Thanks.................. – Rajeev May 9 '11 at 16:33

You can do

date --date="Monday"

to get the date of this Monday. You can also do

date --date="next Monday" 

to get the date of the next Monday. You can also use "last Monday" to get the date of the previous Monday.

Refer to the Man pages for more details.

share|improve this answer
Thanks.......... – Rajeev May 9 '11 at 16:32

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.