So here I've created, or at least tried to create an alias for a command that accepts a command-line argument, makes a new directory with that name, and goes to it.
alias newfolder='mkdir $2 ; cd "$(history | tail -2 | awk '\''NR == 1'\'' | awk '\''{print $3}'\'')"'
The alias created successfully, but when I want to run the command with a command-line argument, I get this error message.
username:~/workspace (master) $ newfolder a
mkdir: missing operand
Try 'mkdir --help' for more information.
bash: cd: newfolder='mkdir: No such file or directory