I'm lazy so I didn't make a gif file..., but you can see what the command I made could do.
~/Desktop/dev ls
~/Desktop/dev mkdird dev.to
~/Desktop/dev ls
dev.to_0805_2106
name: mkdird
arg: string
function: make a folder which names arg_date
First, I tried to add a command to .zshrc
as an alias, but it didn't work well since I could not pass arg
to the command. Then switched creating .sh
file and create a new alias.
Step 1 Create bash/zsh file
$ cd
$ mkdir .sh
$ vim mkdird.sh
#!/usr/bin/env zsh
# create a folder --> arg_date
mkdir $1`date '+_%m%d_%H%M'`
Step 2 Add a new alias
.zshrc
alias mkdird="~/.sh/mkdird.sh"
Step 3 Test
test
$ mkdird dev.to
dev.to_0805_2115
Top comments (0)