grep --ignore-case --only
同时使用--ignore-case和--only-match选项时,grep失败。例: $ echo "abc" | grep -io abc abc $ echo "ABC" | grep -io abc $ 但 $ echo "abc" | grep -i abc abc $ echo "ABC" | grep -i abc ABC 根据手册页: -o, --only-matching Show only the part of a matching line that matches PATTERN. -i, --ignore-case …