Bash Alias Adding a Background Process

7

In my .bashrc, I want to put something like this.

alias lst='ls &'

So that I can do something like this.

$ lst /tmp

which will be translated into

$ ls /tmp &

How can I do the above?

Carmen

Posted 2011-07-12T17:07:08.140

Reputation: 313

Answers

10

Use a function instead.

lst() { ls "$@" & }

garyjohn

Posted 2011-07-12T17:07:08.140

Reputation: 29 085