I am not familiar with bash, but I would like to make an alias that deletes all files starting with a certain string. Here's what I have in my .bashrc
:
alias myrm="rm $1*"
but that does not seem to work properly... What am I missing?
I am not familiar with bash, but I would like to make an alias that deletes all files starting with a certain string. Here's what I have in my .bashrc
:
alias myrm="rm $1*"
but that does not seem to work properly... What am I missing?
Aliases can't use arguments. Use a function instead:
myrm() { rm "$1"*; }
Quoting Bash Reference Manual:
There is no mechanism for using arguments in the replacement text, as in csh. If arguments are needed, a shell function should be used.