Sponsored Content
Top Forums UNIX for Beginners Questions & Answers Mutiple filesearch technique in Linux/UNIX Post 303044409 by sravani25 on Thursday 20th of February 2020 07:53:53 PM
Old 02-20-2020
Mutiple filesearch technique in Linux/UNIX

Hi Team,


I am searching for multiple files in total linux server using shell script, But find command generally searches for the entire server for the files.
which is taking more time for searching. is there any way we can write shell script where it needs to search for multiple files. if any of the file matching with search it needs to stop searching again for it.


Example : I am looking for a1 r3 y7 files in the entire server.

If i use find syntax like below
Code:
find . -type f \( -name "a1" -o -name "*r3" \)

so will it search for "a1" file in entire server and then starts looking for "r3" ?
will it search for multiple files at a time ?.
Moderator's Comments:
Mod Comment
Please use code tags when posting data and code samples!

Last edited by Chubler_XL; 02-20-2020 at 09:55 PM..
 

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Report with mutiple files.

Hi all, In the process of creating CPU reports. I've already used `sar` to create a daily file, then monthly reports for CPU usage (which is averaged across all 4 CPU's). I've now used `cpusar -P ?`(?=CPU#) to collect individual CPU data and have four files for each day which is great. The... (4 Replies)
Discussion started by: Cameron
4 Replies

2. UNIX for Dummies Questions & Answers

Difference Technique's???

Is there any better way of doing this? I only want to find a status of a diff, ie diff the file and return to me whether it is different or not or non-existant. This example works, however I think it could be less messier: workd=`pwd`;find $workd -name "*.sum" | while read line ; do... (1 Reply)
Discussion started by: Shakey21
1 Replies

3. UNIX for Dummies Questions & Answers

FORK/EXEC technique

Hi! Can someone explain me exactly this technique? Why a process (PARENT) creates a copy of itself with FORK (CHILD)? What's the reason of this behaviour? Sorry, but I cannot understand the logic behind it. Thanks. (4 Replies)
Discussion started by: marshmallow
4 Replies

4. Shell Programming and Scripting

How to incorporate mutiple commands in Autosys commandline on UNIX

Hi, I am having a problem running multiple commands in a autosys command line. For example I would like to run a perl script first and then add sleep command after that in the same autosys job like below insert_job: xxxxxxxxx command: `perlscript.pl ; sleep 180` Perlscript.pl... (0 Replies)
Discussion started by: waavman
0 Replies

5. Shell Programming and Scripting

Best search technique

I have a snippet file with the shown below: data file 1 2 1 3 1 3 4 2 3 2 2 1 2 2 5 1 3 2 3 2 2 3 1 4 Actual file has approx 50 Millions such lines with bigger number (9 Replies)
Discussion started by: chakrapani
9 Replies

6. Shell Programming and Scripting

Password Obscuring Technique

Hi, We have a unix shell script which tries login to database. The user name and password to connect to database is stored in a file connection.sql. Now connection.sql has contents def ora_user =&1 CONNECT A_PROXY/abc123@DEV01 When on UNIX server we connect to database and set spool on... (7 Replies)
Discussion started by: Gangadhar Reddy
7 Replies

7. Linux

Best Compression technique ?

Hi all, I am working on a sample backup code, where i read the files per 7200 bytes and send it to server. Before sending to server, i compress each 7200 bytes using zlib compression algorithm using dictionary max length of 1.5 MB . I find zlib is slow. Can anyone recommend me a... (3 Replies)
Discussion started by: selvarajvss
3 Replies

8. Shell Programming and Scripting

Shell script with mutiple steps/commands, on UNIX servers

Hi, I wrote a simple script, which will call other scripts or run commands on a UNIX server. my script has multiple steps/commands with some delay in between. I usually get some email notifications after the successful execution of each step. **My intention is to get email alerts when it is... (5 Replies)
Discussion started by: System Admin 77
5 Replies
nismatch(1)                                                        User Commands                                                       nismatch(1)

NAME
nismatch, nisgrep - utilities for searching NIS+ tables SYNOPSIS
nismatch [-AchMoPv] [-s sep] key tablename nismatch [-AchMoPv] [-s sep] colname = key... tablename nismatch [-AchMoPv] [-s sep] indexedname nisgrep [-AchiMov] [-s sep] keypat tablename nisgrep [-AchiMov] [-s sep] colname = keypat... tablename DESCRIPTION
The utilities nismatch and nisgrep can be used to search NIS+ tables. The command nisgrep differs from the nismatch command in its ability to accept regular expressions keypat for the search criteria rather than simple text matches. Because nisgrep uses a callback function, it is not constrained to searching only those columns that are specifically made searchable at the time of table creation. This makes it more flexible, but slower, than nismatch. In nismatch, the server does the searching, whereas in nisgrep the server returns all the readable entries and then the client does the pattern-matching. In both commands, the parameter tablename is the NIS+ name of the table to be searched. If only one key or key pattern is specified with- out the column name, then it is applied searching the first column. Specific named columns can be searched by using the colname=key syntax. When multiple columns are searched, only entries that match in all columns are returned. This is the equivalent of a logical join opera- tion. nismatch accepts an additional form of search criteria, indexedname, which is a NIS+ indexed name of the form: [ colname=value, ... ],tablename OPTIONS
The following options are supported: -A All data. Return the data within the table and all of the data in tables in the initial table's concatenation path. -c Print only a count of the number of entries that matched the search criteria. -h Display a header line before the matching entries that contains the names of the table's columns -i Ignore upper/lower case distinction during comparisons. -M Master server only. Send the lookup to the master server of the named data. This guarantees that the most up to date infor- mation is seen at the possible expense that the master server may be busy. -o Display the internal representation of the matching NIS+ object(s). -P Follow concatenation path. Specify that the lookup should follow the concatenation path of a table if the initial search is unsuccessful. -s sep This option specifies the character to use to separate the table columns. If no character is specified, the default separa- tor for the table is used. -v Verbose. Do not suppress the output of binary data when displaying matching entries. Without this option binary data is displayed as the string *BINARY*. EXAMPLES
Example 1: Searching a table for a username This example searches a table named passwd in the org_dir subdirectory of the zotz.com. domain. It returns the entry that has the user- name of skippy. In this example, all the work is done on the server: example% nismatch name=skippy passwd.org_dir.zotz.com. Example 2: Finding users using specific shells This example is similar to the one above, except that it uses nisgrep to find all users in the table named passwd that are using either ksh(1) or csh(1): example% nisgrep 'shell=[ck]sh' passwd.org_dir.zotz.com. ENVIRONMENT VARIABLES
NIS_PATH If this variable is set, and the NIS+ table name is not fully qualified, each directory specified will be searched until the table is found (see nisdefaults(1)). EXIT STATUS
The following exit values are returned: 0 Successfully matches some entries. 1 Successfully searches the table and no matches are found. 2 An error condition occurs. An error message is also printed. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWnisu | +-----------------------------+-----------------------------+ SEE ALSO
niscat(1), nisdefaults(1), nisls(1), nistbladm(1), nis_objects(3NSL), attributes(5) DIAGNOSTICS
No memory An attempt to allocate some memory for the search failed. tablename is not a table The object with the name tablename was not a table object. Can't compile regular expression The regular expression in keypat was malformed. column not found: colname The column named colname does not exist in the table named tablename. NOTES
NIS+ might not be supported in future releases of the SolarisTM Operating Environment. Tools to aid the migration from NIS+ to LDAP are available in the Solaris 9 operating environment. For more information, visit http://www.sun.com/directory/nisplus/transition.html. SunOS 5.10 10 Dec 2001 nismatch(1)
All times are GMT -4. The time now is 06:43 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy