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
search.h(3HEAD) 						      Headers							   search.h(3HEAD)

NAME
search.h, search - search tables SYNOPSIS
#include <search.h> DESCRIPTION
The <search.h> header defines the ENTRY type for structure entry, which includes the following members: char *key void *data and defines ACTION and VISIT as enumeration data types through type definitions as follows: enum { FIND, ENTER } ACTION; enum { preorder, postorder, endorder, leaf } VISIT; The size_t type is defined as described in <sys/types.h>. See types.h(3HEAD). ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Interface Stability |Standard | +-----------------------------+-----------------------------+ SEE ALSO
hsearch(3C), insque(3C), lsearch(3C), tsearch(3C), types.h(3HEAD), attributes(5), standards(5) SunOS 5.11 10 Sep 2004 search.h(3HEAD)