linux 中find命令同时对多个关键字进行查找
[root@pc1 test2]# ls ##测试数据 a.txt b.csv c.ped test_dir [root@pc1 test2]# ls test_dir/ [root@pc1 test2]# find ./ -name "*.txt" -o -name "*.ped" -exec cp {} test_dir/ \; ## 查找,并复制到测试目录 [root@pc1 test2]# ls test_dir/ ## 仅出现第二个关键词的内容 c.ped [root@pc1 test2]# rm test_dir/* [root@pc1 test2]# ls test_dir/ [root@pc1 test2]# find ./ \( -name "*.txt" -o -name "*.ped" \) -exec cp {} test_dir/ \; ## 查找,并复制至测试目录 [root@pc1 test2]# ls test_dir/ ## 查找成功 a.txt c.ped

。
 
                    
                     
                    
                 
                    
                
 
                
            
         
         浙公网安备 33010602011771号
浙公网安备 33010602011771号