# Calculate days on which Friday the 13th occurs

for i in {2018..2022}-{01..12}-13; do date --date \$i +"%Y %B %w" | sed '/[^5]\$/d; s/ 5*\$//'; done
Alter the years in the first brace expansion to select your year range. Modify date format to your liking but leave " %w" at the end.
Sample Output
```2018 April
2018 July
2019 September
2019 December
2020 March
2020 November
2021 August
2022 May
```

1
2018-07-09 15:47:39

## 4 Alternatives + Submit Alt

• I removed the dependency of the English language Show Sample Output

5
for y in \$(seq 1996 2018); do echo -n "\$y -> "; for m in \$(seq 1 12); do NDATE=\$(date --date "\$y-\$m-13" +%w); if [ \$NDATE -eq 5 ]; then PRINTME=\$(date --date "\$y-\$m-13" +%B);echo -n "\$PRINTME "; fi; done; echo; done
· 2018-06-25 09:20:57
• Friday is the 5th day of the week, monday is the 1st. Output may be affected by locale. Show Sample Output

3
for i in {2018..2025}-{01..12}-13; do [[ \$(date --date \$i +"%u" | grep 5) != 5 ]] || echo "\$i Friday the 13th"; done
· 2018-07-10 21:31:02
• Simply change the years listed in the first seq, and it will print out all the months in that span of years that have Friday the 13ths in them. Show Sample Output

1
for y in \$(seq 1996 2018); do echo -n "\$y -> "; for m in \$(seq 1 12); do NDATE=\$(date --date "\$y-\$m-13" +%A); if [ \$NDATE == 'Friday' ]; then PRINTME=\$(date --date "\$y-\$m-13" +%B);echo -n "\$PRINTME "; fi; done; echo; done
· 2018-06-13 20:11:46
• Removed grep and simplified if statement. -- Friday is the 5th day of the week, monday is the 1st. Output may be affected by locale. Show Sample Output

0
for i in {2018..2025}-{01..12}-13; do [[ \$(date --date \$i "+%u") == 5 ]] && echo "\$i Friday the 13th"; done
· 2018-07-30 15:54:24

### What Others Think

I really got into this article. I found it to be interesting and loaded with unique points of interest. I like to read material that makes me think. Thank you for writing this great content. ?????
wenilak444 · 36 weeks ago
You have beaten yourself this time, and I appreciate you and hopping for some more informative posts in future. Thank you for sharing great information to us. ???????
wenilak444 · 35 weeks and 6 days ago
Amazing! This blog looks just like my old one! It's on a completely different subject but it has pretty much the same layout and design. Wonderful choice of colors! Pug Puppies for Sale Near Me PUG PUPPY FOR SALE NEAR ME PUG PUPPIES FOR SALE pug puppies for sale in kentucky Pug Puppies for Sale Under \$500 Near Me pug puppies for sale in texas pugs puppies for sale teacup pugs for sale pug puppies for sale by owner pug puppies ohio
rahimhh21 · 31 weeks ago
La formation en ligne en gestion d'entreprise peut être un excellent moyen d'acquérir les compétences dont vous avez besoin pour gérer une entreprise prospère. Les meilleurs cours de gestion d'entreprise en ligne couvrent des sujets tels que la gestion financière, le marketing et les ressources humaines. En suivant un cours en ligne, vous serez en mesure d'apprendre à votre propre rythme et dans votre propre temps. De plus, vous aurez accès à des instructeurs experts qui pourront répondre à toutes vos questions. Que vous cherchiez à créer votre propre entreprise ou que vous en dirigiez déjà une, un cours de gestion d'entreprise en ligne peut vous aider à faire passer votre entreprise au niveau supérieur. formation gestion d'entreprise
wenilak444 · 30 weeks and 6 days ago
This unique looks utterly perfect. Every one of plain and simple records are prepared through the help of great number for working experience handy experience. I will be happy it all for a second time considerably. basketball games lupy
wenilak444 · 30 weeks and 1 day ago
Pug pups for sale are utterly gorgeous, affectionate, and intelligent. Excellent pedigrees, gorgeous coats, finely formed ears, a tight, curled tail, outstanding faces, and a superb conformation like their parents are all present in these puppies. The parents are both in wonderful health and are kind and devoted family members. They will arrive fully registered with the AKC, with pedigree papers, and with a one-year health guarantee. Pug Puppies for Sale Near Me pugs puppies for sale teacup pugs for sale pug puppies for sale by owner pug puppies ohio PUG PUPPY FOR SALE NEAR ME PUG PUPPIES FOR SALE pug puppies for sale in kentucky Pug Puppies for Sale Under \$500 Near Me pug puppies for sale in texas pug puppies for sale \$200 pugs for sale near me under \$500 pugs for sale under \$400 near me pugs for sale near me puppies for sale near me under \$500 pug puppies for sale under \$1,000 near me pug for sale pug puppies for sale under \$300 Brindle Pug Pitbull Pug Mix Pugs for sale cheap Cheap pug affordable pug puppies for sale near me black pugs for sale near me White Pugs for sale pug dog for sale free pug puppies pug puppies for sale in my area mn pug breeders pug puppies indiana pugs for sale michigan PUG PUPPY ADOPTION Pug puppies for sale Pug puppies for sale near me Pug puppies near me Pug Puppies for Sale Under \$500 Near Me Cute Pug Puppies Black pug puppies Black pug puppies for sale pug puppies for adoption black pug puppies for sale near me chihuahua pug mix puppies how much is a pug puppy teacup pug puppies baby pug puppies pictures of pug puppies pug puppies for sale in Ohio pug puppies price pug mix puppies teacup pug puppies for sale best food for pug puppy newborn pug puppies pug puppies craigslist pug puppies for sale craigslist adorable pug puppies how much does a pug puppy cost Pitbull pug mix puppies pug pit mix puppy pug puppies for sale \$200 pug puppies for sale in NJ Pug puppies for sale in Wisconsin pug puppy cost pug puppy food royal canin pug puppy royal canin pug puppy food fawn pug puppy pug puppies for sale florida pug puppies for sale in Indiana pug puppies for sale in KY pug puppies for sale in NC pug dog puppy AKC Registered Pug Puppies For sale cheap pug puppies for sale near me cheap pug puppies for sale in California cheap pug puppies for sale in nj Black Pug Puppies for sale pugs puppies for sale
ExcellentHome · 27 weeks and 4 days ago
An fascinating discussion is value comment. I feel that you must write extra on this matter, it may not be a taboo topic but generally individuals are not enough to speak on such topics. To the next. Cheers deep web
wenilak444 · 21 weeks and 1 day ago
Took me awhile to read all the comments, but I really enjoyed the article. It proved to be very helpful to me and I am sure to all the commenters here! It’s always nice when you can not only be informed, but also entertained! I’m sure you had fun writing this article. dark web sites
wenilak444 · 21 weeks and 1 day ago
Do you mind if I quote a few of your posts as long as I provide credit and sources back to your webpage? My blog site is in the very same area of interest as yours and my users would truly benefit from a lot of the information you provide here. Please let me know if this ok with you. Thanks a lot! work from home jobs
wenilak444 · 21 weeks and 1 day ago
Thanks for some other excellent article. Where else could anyone get that kind of information in such a perfect way of writing? I’ve a presentation next week, and I am at the look for such info. affiliate marketing
wenilak444 · 21 weeks and 1 day ago
I just like the valuable information you provide in your articles. I’ll bookmark your weblog and take a look at once more right here frequently. I am quite certain I’ll learn lots of new stuff right here! Good luck for the following! automatic sliding glass door bd
wenilak444 · 21 weeks and 1 day ago
I am happy to find this post Very useful for me, as it contains lot of information. I Always prefer to read The Quality and glad I found this thing in you post. Thanks ??????
wenilak444 · 20 weeks and 2 days ago
That is the reason focus on you must specific groundwork well before authoring. Will be possible to more desirable blog post in this manner. ??????
wenilak444 · 19 weeks ago
I wanted to say thank you to you for this excellent read!! I have you saved as a favorite to see fresh stuff you post. admin jarwo slot Thank you for the good critique. Me and my neighbor were just preparing to do a little research on this. We got a book from our local library but I think I’ve learned better from this post. I am very glad to see such wonderful info being shared freely out there.. admin jarwo slot There is noticeably a bundle to understand this. I suppose you have made specific nice points in features also. bocoran jarwo
wenilak444 · 10 weeks and 6 days ago
The main reason why it's always a lot better that one can significant researching preceding doing. You'll be able to share improved page using this method. situs rtpgacor77
wenilak444 · 6 weeks ago
My brother recommended I may like this website. He was once totally right. This put up actually made my day. You can not believe simply how a lot time I had spent for this information! Thanks! slot gacor
wenilak444 · 5 weeks and 6 days ago

### What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

### What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.