My project folder used to look like this:
new-site/
new-site-2/
new-site-final/
new-site-final-ACTUAL/
test-backup/
backup-old/
Yours probably looks similar. We've all been there. You start a project, name the folder something reasonable, and then six months later there are four variations of it and you have no idea which one is current.
The fix is embarrassingly simple: put the date in the folder name when you create it.
The Command
mkdir "$(date +%Y-%m-%d)_project-name"
That creates: 2026-05-22_project-name
That's it. One command. But the trick is making it effortless enough that you actually use it every time.
Make It an Alias
Open your .bashrc (or .zshrc if you're on macOS/zsh):
nano ~/.bashrc
Add this line at the bottom:
alias mktoday='mkdir "$(date +%Y-%m-%d)_${1:-project}"'
Save, then reload:
source ~/.bashrc
Now you can type:
mktoday client-redesign
And get: 2026-05-22_client-redesign
No thinking. No formatting. No "was it DD-MM or MM-DD?" The alias handles it.
Why YYYY-MM-DD and Not Anything Else
This isn't a style preference. It's a sorting issue.
If you use MM-DD-YYYY (the American date format), your folders sort like this:
01-15-2026_project/
02-03-2025_project/
03-22-2026_project/
12-01-2024_project/
That's sorted by month, not by date. January 2026 comes before February 2025. Useless.
With YYYY-MM-DD (ISO 8601), they sort correctly:
2024-12-01_project/
2025-02-03_project/
2026-01-15_project/
2026-03-22_project/
Chronological order. In every file manager. In every ls output. On every operating system. This is why ISO 8601 exists.
The Script Version (With Backup Built In)
If you want the folder creation to also copy files into it — like a timestamped backup — here's the expanded version:
#!/bin/bash
SOURCE="/home/user/documents"
BACKUP_ROOT="/backup"
DATE=$(date +%Y-%m-%d_%H-%M)
DEST="$BACKUP_ROOT/$DATE"
mkdir -p "$DEST"
cp -r "$SOURCE" "$DEST"
echo "✓ Backed up to: $DEST"
This is the same concept but applied to automation. Create a dated folder, copy files into it, done. Schedule it with cron and you've got timestamped versioned backups.
The date Format Codes You'll Actually Use
You don't need to memorize all of them. Here are the ones that matter:
%Y — 4-digit year (2026)
%m — 2-digit month (05)
%d — 2-digit day (22)
%H — Hour in 24h format (14)
%M — Minutes (30)
%b — Abbreviated month name (May)
So date +%Y-%m-%d gives you 2026-05-22 and date +%Y-%m-%d_%H-%M gives you 2026-05-22_14-30 if you need time precision too.
Common Mistakes
Forgetting quotes around the folder name. If your project name has spaces, mkdir $(date +%Y-%m-%d)_my project creates two things: a folder called 2026-05-22_my and whatever bash makes of the word project on its own. Always wrap it: mkdir "$(date +%Y-%m-%d)_my project".
The alias not surviving a reboot. Adding alias mktoday=... in the terminal works for that session only. You have to put it in ~/.bashrc AND run source ~/.bashrc for it to stick.
This is one of those things that takes 30 seconds to set up and quietly makes your life better every week. Full walkthrough, more format examples, and the backup version:











