Tuesday, July 5, 2011

Create a directory with current date and time as name using a single command

Linux bash command for creating a directory with current date and time.

mkdir `date +%Y%m%d%H%M%S`
 
This will make a directory in the working directory with year, month, day, hour, minute and second. Add alias in .bashrc file

alias mdr="mkdir `date +%Y%m%d%H%M%S`"

No comments:

Post a Comment