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

hibernate - How to load global settings frequently used in application in Java -

python 3.x - Mapping specific letters onto a list of words -

objective c - Ownership modifiers with manual reference counting -