i have the following alias set in my .bashrc:
alias la='ls -laG'
but i would really like to issue a command thusly:
la foo/bar
i guess i have to write a shell script? or is there some xargs way?
i have the following alias set in my .bashrc:
alias la='ls -laG'
but i would really like to issue a command thusly:
la foo/bar
i guess i have to write a shell script? or is there some xargs way?
This works for me. It will replace la
with ls -laG
, such that your command will be executed as ls -laG foo/bar
.
For your task you do not need parameters. (Or did I miss something?) However, you could write a shell function that take arguments. I use to have something like
function ccd () { mkdir -p $1 && cd $1; }
in my .bashrc
. So I can (c)reate and (c)hange (d)ir in one step by typing
ccd temp1