I'm trying to create a alias combining ls | grep | and xargs xdg-open
.
This is what I've tried so far. Not sure why it is not working.
alias lso='ls | grep "$1" | xargs -I {} xdg-open {}'
alias lso='ls | grep "$@" | xargs -I {} xdg-open {}'
alias lso='ls | grep | xargs -I {} xdg-open {}'
The idea is be able to to this in the terminal:
$ lso example
The interesting thing is that I can use this using the terminal:
$ ls | grep example | xargs -I {} xdg-open {}'
Does anyone have any work around that?