This article is a mirror article of machine translation, please click here to jump to the original article.

View: 15511|Reply: 1

[linux] Linux looks for files that contain a certain character under the folder

[Copy link]
Posted on 2020-7-18 17:06:52 | | | |
System: centos 7, folder address: /alidata/log/nginx/date



The Linux grep command is used to find strings in a file that match the conditions. The grep command is used to find files with a specified template style, and if the content of a file is found to match the specified template style, the default grep command will display the column containing the template style. If no file name is specified, or if the file name given is -, the grep command reads the data from the standard input device.

  • -r is a recursive lookup
  • -n is the line number that displays it
  • -R Find all files containing subdirectories
  • -i ignores case


I want to find all the folders that contain "123456789." The command is as follows:


The results are as follows:






Previous:C# Unity Series (1) Console programs implement interface dependency injection
Next:Alibaba Cloud configures ECS to allow access only from SLB load balancers
 Landlord| Posted on 2022-2-17 13:50:42 |
Look for the file that contains test under the /data/service directory *.info.log

Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com