bash: find multiple types[solved]


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting bash: find multiple types[solved]
# 1  
Old 02-03-2012
bash: find multiple types[solved]

Hi,

I would like to use find to search for multiple types. For example search for symlink and regular file but not directories, sockets etc.... Something like:

Code:
find . -type l,f -name "stuff"

But of course it does not work.
Is there any way to avoid an if statement and to do it faster?

I searched the forum but I found something related to multiple file name (extension) but not type.

Thanks in advance

D.

---------- Post updated at 12:20 PM ---------- Previous update was at 12:17 PM ----------

==========================
OK Sorry I got it

Code:
find . -type f -o -type l -name "stuff"

it seems to work.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Script to find file types and info

I'm looking for a way to inventory files on a webserver into a CSV file, and am particularly interested in certain types of files, like .php, .cgi, .pl, .py, .sh, etc. but also want the ability to find all files, including those with no extension, or specified extensions, as above, including files... (1 Reply)
Discussion started by: spacegoose
1 Replies

2. Shell Programming and Scripting

Using a single "find" cmd to search for multiple file types and output individual files

Hi All, I am new here but I have a scripting question that I can't seem to figure out with the "find" cmd. What I am trying to do is to only have to run a single find cmd parsing the directories and output the different file types to induvidual files and I have been running into problems.... (3 Replies)
Discussion started by: swaters
3 Replies

3. Shell Programming and Scripting

Bash enumerated types

I have a variable, vbLevel and want to assign it to one of several values which are "none", "low", "medium", "high". Then I want to do something like if ; then ... fi (9 Replies)
Discussion started by: kristinu
9 Replies

4. UNIX for Dummies Questions & Answers

How to find the partition types in linux

How do we find the partition type in Linux? df -T will give me the mounted partition types like ufs, ext3 etc. How do I find out for say a newly added disk to the system? Please advise... Thanks (2 Replies)
Discussion started by: lubu
2 Replies

5. Shell Programming and Scripting

How to pass multiple file types search pattern as argument to find?

How can I pass $var_find variable as argment to find command? test.sh var_find=' \( -name "*.xml" -o -name "*.jsp" \) ' echo "${var_find}" find . -type f ${var_find} -print # Below statement works fine.. I want to replace this with the above.. #find . \( -name "*.xml" -o -name... (4 Replies)
Discussion started by: kchinnam
4 Replies

6. Linux

Simplified find command to find multiple file types

Hi, I'm using the following command to find the multiple requierd file types and its working fine find . -name "*.pl" -o -name "*.pm" -o -name "*.sql" -o -name "*.so" -o -name "*.sh" -o -name "*.java" -o -name "*.class" -o -name "*.jar" -o -name "*.gz" -o -name "*.Z" -type f Though... (2 Replies)
Discussion started by: vickramshetty
2 Replies

7. Shell Programming and Scripting

flexible sed command needed to handle multiple input types

Hello, I need a smart sed command that can take any of the following two as an input and give below mentioned output. As you can see, I am trying to convert some C code INPUT: struct abc_sample1 { char myString; UINT16 myValue1; ... (2 Replies)
Discussion started by: SiftinDotCom
2 Replies

8. Shell Programming and Scripting

find multiple file types and tar

There are these ksh files and config files that are written and updated on a daily basis. All I want to do is write a script that finds both these types of files and archive them on a daily basis, to help in restoring in times of system outages and so on. Particulary I'm interested in .ksh ,... (9 Replies)
Discussion started by: manthasirisha
9 Replies

9. UNIX for Dummies Questions & Answers

find directory with 2 types of files

Trying to use the find command to find any directory which contains a file ending in .zip AND a file ending in .o I'm having trouble specifying multiple files as criteria and have can't seem to figure it out from Unix in a Nutshell and Google. (2 Replies)
Discussion started by: dangral
2 Replies
Login or Register to Ask a Question
UDM_FIND(3)								 1							       UDM_FIND(3)

udm_find - Perform search

SYNOPSIS
resource udm_find (resource $agent, string $query) DESCRIPTION
Performs a search. The search itself. The first argument - session, the next one - query itself. To find something just type words you want to find and press SUBMIT button. For example, "mysql odbc". You should not use quotes " in query, they are written here only to divide a query from other text. mnoGoSearch will find all documents that contain word "mysql" and/or word "odbc". Best documents having bigger weights will be dis- played first. If you use search mode ALL, search will return documents that contain both (or more) words you entered. In case you use mode ANY, the search will return list of documents that contain any of the words you entered. If you want more advanced results you may use query language. You should select "bool" match mode in the search from. PARAMETERS
o $agent - A link to Agent, received after call to udm_alloc_agent(3). o $query - mnoGoSearch understands the following boolean operators: & - logical AND. For example, "mysql & odbc". mnoGoSearch will find any URLs that contain both "mysql" and "odbc". | - logical OR. For example "mysql|odbc". mnoGoSearch will find any URLs, that contain word "mysql" or word "odbc". ~ - logical NOT. For example "mysql & ~odbc". mnoGoSearch will find URLs that contain word "mysql" and do not contain word "odbc" at the same time. Note that ~ just excludes given word from results. Query "~odbc" will find nothing! () - group command to compose more complex queries. For example "(mysql | msql) & ~postgres". Query language is simple and powerful at the same time. Just consider query as usual boolean expression. RETURN VALUES
Returns a result link identifier on success or FALSE on failure. PHP Documentation Group UDM_FIND(3)