02-17-2006
Ya matrixmadhan...... you are right . I am not sure which files out of those 40000 file contains a search pattern..
suppose that I have files 1x,2x,3x........,40000x .
So, how are you going to use find piped to xargs , say to search pattern "N1cd56" in the above 40000 files.
please tell me the usage.
Thanks,
Aru
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
I have a challenging task,in which i have to find the duplicate files by its name and size,then i need to take anyone of the file.Then i need to open the file and find for more than one pattern and count of that pattern.
Note:These are the samples of two files,but i can have more... (2 Replies)
Discussion started by: jerome Sukumar
2 Replies
2. UNIX for Dummies Questions & Answers
before i get to it, i would like to say this is the greatest unix site ive ever seen, and im glad to see so many people are out there to help. thanks
well, im trying to make myself a script where i can specify a directory and a file size so that my script will show me any files larger than the... (5 Replies)
Discussion started by: linuxlaptop
5 Replies
3. Shell Programming and Scripting
Hi power user,
For examples, I have three different files:
file 1: file2: file 3:
AAA CCC ZZZ
BBB BBB CCC
CCC DDD DDD
DDD TTT AAA
EEE AAA XXX
I... (8 Replies)
Discussion started by: anjas
8 Replies
4. UNIX for Dummies Questions & Answers
I hope I'm asking this the right way --
I've been sending out a lot of resumes and some of them I saw on Craigslist -- so I named the file as 'Craigslist -- (filename)'. Well I noticed that at least one of the files was misspelled as 'Craigslit.'
I want to eventually try to write a shell... (5 Replies)
Discussion started by: Straitsfan
5 Replies
5. Shell Programming and Scripting
Hi All,
I am trying to find 4 latest files inside one folder having following File Name pattern and store them into 4 different variables and then use for processing in my shell script. File name is fixed length.
1) Each file starts with = ABCJmdmfbsjop letters + 7 Digit Number... (6 Replies)
Discussion started by: lancesunny
6 Replies
6. Shell Programming and Scripting
I have unix file like below
>newuser
newuser
<hello
hello
newone
I want to find the unique values in the file(excluding <,>),so that the out put should be
>newuser
<hello
newone
can any body tell me what is command to get this new file. (7 Replies)
Discussion started by: shiva2985
7 Replies
7. Shell Programming and Scripting
I have logs files which are generated each day depending on how many processes are running. Some days it could spin up 30 processes. Other days it could spin up 50. The log files all have the same pattern with the number being the different factor. e.g.
LOG_FILE_1.log
LOG_FILE_2.log etc etc
... (2 Replies)
Discussion started by: atelford
2 Replies
8. UNIX for Dummies Questions & Answers
Hi,
I am using AIX and one of my file systems is getting filled up and I need to track with files are occupying more volume.
Filesystem GB blocks Free %Used Iused %Iused Mounted on
/dev/nhdb_lv 2110.00 63.80 97% 76525 1% /nhdb
under the Mount Point /nhdb... (1 Reply)
Discussion started by: zulfi123786
1 Replies
9. Shell Programming and Scripting
Hi All,
I need to find all files in a directory which are containing specific pattern. Thing is that file name should not consider if pattern is only in commented area.
all contents which are under /* */ are commented
all lines which are starting with -- or if -- is a part of some sentence... (13 Replies)
Discussion started by: Lakshman_Gupta
13 Replies
10. Shell Programming and Scripting
i am using sed to detect any lines that are not exactly 21. the following gives me the lines that ARE exactly 21. i want the opposite , i want the two lines that are not size 21 (shown in bold)
type a.a
000008050110010201NNN
000008060810010201NNN
21212000008070110010201NNN... (5 Replies)
Discussion started by: boncuk
5 Replies
LEARN ABOUT MOJAVE
mdfind
mdfind(1) BSD General Commands Manual mdfind(1)
NAME
mdfind -- finds files matching a given query
SYNOPSIS
mdfind [-live] [-count] [-onlyin directory] [-name fileName] query
DESCRIPTION
The mdfind command consults the central metadata store and returns a list of files that match the given metadata query. The query can be a
string or a query expression.
The following options are available:
-0 Prints an ASCII NUL character after each result path. This is useful when used in conjunction with xargs -0.
-live Causes the mdfind command to provide live-updates to the number of files matching the query. When an update causes the query
results to change the number of matches is updated. The find can be cancelled by typing ctrl-C.
-count Causes the mdfind command to output the total number of matches, instead of the path to the matching items.
-onlyin dir
Limit the scope of the search to the directory specified.
-name fileName
Searches for matching file names only.
-literal Force the provided query string to be taken as a literal query string, without interpretation.
-interpret Force the provided query string to be interpreted as if the user had typed the string into the Spotlight menu. For example, the
string "search" would produce the following query string:
(* = search* cdw || kMDItemTextContent = search* cdw)
EXAMPLES
The following examples are shown as given to the shell.
This returns all files with any metadata attribute value matching the string "image":
mdfind image
This returns all files that contain "MyFavoriteAuthor" in the kMDItemAuthor metadata attribute:
mdfind "kMDItemAuthors == '*MyFavoriteAuthor*'"
This returns all files with any metadata attribute value matching the string "skateboard". The find continues to run after gathering the
initial results, providing a count of the number of files that match the query.
mdfind -live skateboard
To get a list of the available attributes for use in constructing queries, see mdimport(1), particularly the -X switch.
SEE ALSO
mdimport(1), mdls(1), mdutil(1), xargs(1)
Mac OS X June 10, 2004 Mac OS X