shell - create a custom Linux command for repetitive commands -


i find myself running command time

grep -r "somestring" /workplace/scripts /workplace/server 

i replace simple custom command

s "somestring" 

which same thing.

how do this? i'm new linux.

your example suggests variable search string. define function:

s() {   grep -r -- "$1" /workplace/scripts /workplace/server } 

and invoke saying:

s "somestring" 

Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -