Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
alias cgrep='current_dir_grep' function current_dir_grep_exact { grep -w $1 . } alias cgrepe='current_dir_grep_exact'
grep -w 'label for' .工作,但cgrepe 'label for'只搜索出现,label而我想label for在当前目录中找到出现。
grep -w 'label for' .
cgrepe 'label for'
label
label for
将论点放在引号中:
grep -w "$1" .
在bash(1)中,别名不带参数。有时看起来他们这样做,但他们没有。使用一个函数。
bash(1)