Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Find directory name with wildcard or similar to "like"

Tags:

directory

unix

I am using the following command to find a directory name.

 find / -type d -name "ora10" 

My problem is, I am not sure what the exact directory name is, so I would like to find directories similar to "ora10g", "ora10client", etc.

How can I do this with find?

like image 353
jdamae Avatar asked Aug 01 '12 18:08

jdamae


People also ask

How do you use wildcards to search files and folders?

You can use your own wildcards to limit search results. You can use a question mark (?) as a wildcard for a single character and an asterisk (*) as a wildcard for any number of characters. For example, *. pdf would return only files with the PDF extension.

Which are the wildcard characters for finding a file folder?

Wildcard character is a special character that represents one or more other characters. Wildcard characters are often used when you do not know the exact name of file/folder or you do not want to type the entire name. There are two wildcard characters: asterisk (*) and question mark (?).

How do you use a wildcard in a filename?

When you have a number of files named in series (for example, chap1 to chap12) or filenames with common characters (like aegis, aeon, and aerie), you can use wildcards (also called metacharacters) to specify many files at once. These special characters are * (asterisk), ? (question mark), and [ ] (square brackets).

What is wildcard in Linux with examples?

The wildcard '*' means it will match any number of characters or a set of characters. For example, S**n will match anything between S and n. The number of characters between them do not count. Syntax: ll A*f.


1 Answers

find supports wildcard matches, just add a *:

find / -type d -name "ora10*" 
like image 179
Hunter McMillen Avatar answered Sep 27 '22 21:09

Hunter McMillen