mkdir with date name? [duplicate]

Solution 1:

The concept you're looking for is command substitution, which uses the syntax $(command)

mkdir /home/john/$(date +%M)

You may also see the older 'backtick' syntax, `command`

Solution 2:

mkdir $(date +%Y%m%d) or I personnaly use mkdir $(date +%Y%m%d_%H%M%S) for hh:mm:ss. date --help will give you the different formats if you need something more.