博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
linux搜索指定文件内容的文件列表,同时指定被搜索的文件格式
阅读量:2021 次
发布时间:2019-04-28

本文共 241 字,大约阅读时间需要 1 分钟。

linux搜索指定文件内容的文件列表,同时指定被搜索的文件格式

 

从根目录开始查找所有扩展名为.txt的文本文件,并找出包含”我要找的文件要包含的文字内容”的行

find / -type f -name "*.txt" | xargs grep "我要找的文件要包含的文字内容"

例子:从当前目录开始查找所有扩展名为.txt的文本文件,并找出包含”我要找的文件要包含的文字内容”的行
find . -name "*.txt" | xargs grep "我要找的文件要包含的文字内容"

转载地址:http://garxf.baihongyu.com/

你可能感兴趣的文章
Python find()和index()区别
查看>>
LeetCode005. Longest Palindromic Substring
查看>>
LeetCode019. Remove Nth Node From End of List
查看>>
LeetCode023. Merge k Sorted Lists
查看>>
LeetCode024. Swap Nodes in Pairs
查看>>
LeetCode061. Rotate List
查看>>
LeetCode104. Maximum Depth of Binary Tree (思路及python解法)
查看>>
LeetCode106. Construct Binary Tree from Inorder and Postorder Traversal (思路及python解法)
查看>>
LeetCode105. Construct Binary Tree from Preorder and Inorder Traversal (思路及python解法)
查看>>
LeetCode113. Path Sum II (思路及python解法)
查看>>
LeetCode116. Populating Next Right Pointers in Each Node(思路及python解法)
查看>>
LeetCode117. Populating Next Right Pointers in Each Node II(思路及python解法)
查看>>
LeetCode129. Sum Root to Leaf Numbers (思路及python解法)
查看>>
LeetCode200. Number of Islands (思路及python解法)
查看>>
LeetCode130. Surrounded Regions (思路及python解法)
查看>>
LeetCode299. Bulls and Cows(思路及python解法)
查看>>
LeetCode617. Merge Two Binary Trees (思路及python解法)
查看>>
LeetCode412. Fizz Buzz(思路及python解法)
查看>>
LeetCode46. Permutations (思路及python解法)
查看>>
LeetCode347. Top K Frequent Elements(思路及python解法)
查看>>