首页 > 代码库 > grep -C n "匹配字符串" 匹配字符串上下N行

grep -C n "匹配字符串" 匹配字符串上下N行

 

 

[root@xxxxx ~]# grep -C 5 ip_whitelist /etc/gitlab/gitlab.rb#   PATH => "/opt/gitlab/bin:/opt/gitlab/embedded/bin:/bin:/usr/bin"# }# gitlab_rails[rack_attack_git_basic_auth] = {#   enabled => true,#   ip_whitelist => ["127.0.0.1"],#   maxretry => 10,#   findtime => 60,#   bantime => 3600# }

 

grep -C n "匹配字符串" 匹配字符串上下N行