PS) new-alias grep findstr
PS) ls -r *.txt | cat | grep "some random string"
解释:
ls - lists all files
-r - recursively (in all files and folders and subfolders)
*.txt - only .txt files
| - pipe the (ls) results to next command (cat)
cat - show contents of files comming from (ls)
| - pipe the (cat) results to next command (grep)
grep - search contents from (cat) for "some random string" (alias to findstr)
是的,这也可以:
PS) ls -r *.txt | cat | findstr "some random string"