QA Graphic

Creating Sequential Directories

Tips on creating multiple directories in Terminal

There's an easy way to create a number sequence directories. This is useful when your creating directories for days of a month. I did this for a while organizing blog postings.

To create ten directories starting with the number 21:

mkdir {21..31}

If you need to create a directory with a leading zero:

mkdir $(printf "%02i " $(seq 1 20))

To do a directory in this format: MM-DD Simple use this:

mkdir $(date '%b-%d')

Hope this gives people ideas on different ways to create directories.

 

About

A Mac veteran since 1989, I'm here to share my experience with tips and tricks every Friday. Witnessing the evolution of Mac software and hardware firsthand, I've gained a deep understanding of how these machines work and can help you troubleshoot any issues that may come up.

Schedule

FridayMacintosh
SaturdayInternet Tools
SundayOpen Topic
MondayMedia Monday
TuesdayQA
WednesdayAffinity
ThursdayBBEdit