文本搜索工具.

grep: global search regular expression(RE) and print out the line,全面搜索正则表达式并把行打印出来

一种强大的文本搜索工具,它能使用正则表达式搜索文本,并把匹配的行打印出来。

示范文本 1.txt ~~~ var now = new Date(); console.log(now); console.log(now.getFullYear()); console.log(now.getMonth()); console.log(now.getDate()); console.log(now.getDay()); console.log(now.getHours()); console.log(now.getMinutes()); console.log(now.getSeconds()); console.log(now.getMilliseconds()); console.log(now.getTime());

实际例子 ➜ Desktop grep Day 1.txt console.log(now.getDay()); // 包含 Day 的行.

➜ Desktop grep day 1.txt ➜ Desktop // 无匹配结果

➜ Desktop grep -i day 1.txt console.log(now.getDay()); // i 忽略大小写