How to find files in a directory using grep with wildcards?
source link: https://www.codesd.com/item/how-to-find-files-in-a-directory-using-grep-with-wildcards.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
How to find files in a directory using grep with wildcards?
I have several hundred files with file names such as: 20110404_091415-R1-sometext
Another file name might be named: 20110404_091415-R1.2-sometext
What I would like to do is use the Unix grep tool in the terminal to find files that start with 2011 and also contain -R1 within the file name. Unfortunately, I have no idea to find files that satisfy both these criteria. I have tried to figure out a regex that would match this, but I am only a beginner programmer. Can anyone help please? Thanks in advance for your time.
why even use grep? I think ls 2011*R1*
should suffice..
Related Articles
How to find files in a directory that do not have extension?
listing files in the directory using grep
How to find patterns on multiple lines using grep?
How to list files in a directory using the Windows API?
How to download files directly on S3 using PHP and with progress bar
How to browse files in a directory?
Count the number of files in a directory using Java
Rename multiple files in a directory using Python
Get the last modified date of the files in the directory using PHP
How to find @username in a string using regex
Using grep with a pattern file: print single and duplicate entries
Use grep with a large signature file
Use grep with a regular expression to filter matches
How to read data from all files in a directory using C Language?
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK