Question
As title with text file as below:
- test.txt
- This is line1
- # This is the line being commented
- This is line2
How-To
Try command egrep or grep with argument '-E':
This is a blog to track what I had learned and share knowledge with all who can take advantage of them
This is line1
This is line2
// -E: Interpret PATTERN as an extended regular expression
// -v, --invert-match: Invert the sense of matching, to select non-matching lines.
# grep -E -v '^$|^\s*#' test.txt
This is line1
This is line2
# egrep -v '^$|^\s*#' test.txt
This is line1
This is line2
Source From Here 方案1: // x -----删除忽略文件已经对 git 来说不识别的文件 // d -----删除未被添加到 git 的路径中的文件 // f -----强制运行 # git clean -d -fx 方案2: 今天在服务器上 gi...
沒有留言:
張貼留言