how to get day of the year in shell?

Reza Toghraee picture Reza Toghraee · Apr 11, 2012 · Viewed 22.3k times · Source

How can I get the day of the year in shell?

date '+%V' will give me the week of the year, which is 15 for today; but I need to find the day of the year!

Answer

Mat picture Mat · Apr 11, 2012

From the coreutils date manual:

%j     day of year (001..366)