On Sat, Oct 01, 2016 at 09:03:15PM +0200, Antoni V. wrote:
Hi,
> netstat -lantp | grep -i stab | awk -F/ '{print $2 $3}' | sort | uniq
>
>[…]
>
> 1- add it to .mkshrc as \alias using=
> 2- create /usr/bin/using (chmod +x) and add the one liner to it
>
> Both will work the exact same way.
> So I think, which one is better? Faster?
Better: it depends from where you call it. When it's exclusively
interactively from a terminal, I personaly make an alias to not
encumber my PATH (more).
Faster: don't bother, you can't however humanly notice it.
(BTW, I think you might shrink it a bit:
netstat -lantp | grep -i stab | awk -F/ '{print $2 $3}' | sort -u
or, if you want to save the grep process:
netstat -lantp | awk -F/ '/[sS][tT][aA][bB]/{print $2 $3}' | sort -u
)
My 2 cents.
++
Seb.