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.
我想为递归搜索目录内的文本创建自定义别名。目前我用这个
grep -r "text to search" /var/www/sites
我要先
myalias
myalias text-to-search (without quotes)
这可能吗
把它放在你的 ~/.bashrc 中:
wwwgrep() { find /var/www/sites -name '*.php' -o -name '*.html' -exec grep -Hn "$1" {} \; }
然后
wwwgrep <PATTERN>
最后(刷新您的环境)
exec bash