4 ms·
As jstimpfle mentioned, that doesn't work, which is why the argument is left off the alias. In general, you can do that in a function instead of an alias:
by pdkl95 11y ago
As jstimpfle mentioned, that doesn't work, which is why the argument is left off the alias. In general, you can do that in a function instead of an alias:
lsr() {
find . -name "$1"
}
Wrapping variable expansion with double quotes is a good habit, so spaces are handled properly.
Also, if you are using a modern-ish bash, you almost always want to use "$@" when there could be multiple arguments. The double-quoted @ special variable is guaranteed to always expand as multiple args, but with spaces handled correctly:
foo() {
bar --quux=42 "$@"
}
foo "a b c" "Spaces in my filename.txt"