08-29-2008
Shell:Find a word in files in a directory and subdirectories
I'm looking to write a ksh code with will be alble to find a word like 'toto' in all files going from my current directory.
eg.
/doc ----------->have: text.c which "toto"
/doc/usr-------->have: build.pc, help.java which "toto"
/doc/usr/cach -->have: test.sh which "toto"
/doc/build ------>Have Succes.ls which "toto"
Can you help me whith a code source?
Thanks
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Is there a command or shell script which can be used for Finding all files created by a specified userid in a directory and its subdirectories.
Say, I want to find all such files in directory /abc as well as in all the subdirectories such as /abc/xyz or /abc/xyz/pqr aqnd so on which was created... (5 Replies)
Discussion started by: abhilashnair
5 Replies
2. UNIX for Dummies Questions & Answers
I want to find a specific word present in all the files ina directory....Please tell me the command to be used??
Thanks (6 Replies)
Discussion started by: shikhakaul
6 Replies
3. UNIX for Dummies Questions & Answers
Hi,
I have a filename Location.txt in a directory /abc.
Similar name file is present in its subdirectory /abc/xyz.
I want to find the file which is present only in /abc and not in /abc/xyz.
Please any1 of u can provide a quick suggestion.
Its very urgent.
Thanks,
Amol (2 Replies)
Discussion started by: Amol_Dicholkar
2 Replies
4. Shell Programming and Scripting
hi all,
i need to capture all the files in a directory and its subdirectories that have owner name different than the root owner.
for one file it is " stat -c %U filename " but i need to search for each and every file and record it.
thanks in advance (14 Replies)
Discussion started by: vyasa
14 Replies
5. Shell Programming and Scripting
Hi,
I have a parent directory in which I have sub directories of different depth
/usr/usr1/user2/671
/usr/usr1/672
/usr/user2/user1/673
/usr/user2/user3/user4/674
And I need the names of all the directories that which starts only with 6 in a file.
Thanks, (12 Replies)
Discussion started by: arun_maffy
12 Replies
6. Shell Programming and Scripting
Hi Everyone,
I am looking for a simple way for replacing all the files under a directory that use the server "xsgd1234dap" with "xsdr3423pap".
For Example:
In the Directory,
$pwd
/home/nick
$ grep -l "xsgd1234dap" *.sh | wc -l
119
I have "119" files that are still using... (5 Replies)
Discussion started by: filter
5 Replies
7. Shell Programming and Scripting
Hi,
I have to find files only in the current directory...not in the sub directories.
But when I use Find command ... it searches all the files in the current directory as well as in the subdirectories. I am using AIX-UNIX machine.Please help..I tried to use maxdepth..but it is not working in AIX. (2 Replies)
Discussion started by: vsachan
2 Replies
8. Shell Programming and Scripting
Hi Forum,
I am using the below command to find files older than x days in a directory excluding subdirectories. From the previous forums I got to know that prune command helps us not to descend in subdirectories. Though I am using it here, not getting the desired result.
cd $dir... (8 Replies)
Discussion started by: jhilmil
8 Replies
9. Shell Programming and Scripting
Hi folks,
i have a file in which i have words like below
words.txt(file name) and words are arranged likes no spaces between words
Apple
Banana
Carrot
And i have list files which have these words in a directory (/tmp/satemp)
test1.txt
test2.txt
test3.txt
So if the word 'Apple' is... (3 Replies)
Discussion started by: coolboy98699
3 Replies
10. Shell Programming and Scripting
Hi All,
requirement is to find and remove the files from sub directories but it should exclude the files from parent directory.
At present i am using the below one but it finds and remove files from both parent and sub directories.
find ${PATH} -type f \( -name securitas\* -o -name \*gz... (1 Reply)
Discussion started by: Naveenkk
1 Replies
LEARN ABOUT DEBIAN
declar
DECLAR(3) GENPAT functions DECLAR(3)
NAME
DECLAR, GENPAT Package
ORIGIN
This software belongs to the ALLIANCE CAD SYSTEM developed by the ASIM team at LIP6 laboratory of Universite Pierre et Marie CURIE, in
Paris, France.
Web : http://asim.lip6.fr/recherche/alliance/
E-mail : alliance-users@asim.lip6.fr
SYNOPSYS
DECLAR("ident",":nb_space","format",mode,size,option);
PARAMETERS
ident External connector, internal observing points or register's name. For the hierarchical descriptions, the path-name of the inter-
nal observing points or registers must be specified by the syntax : instance1.instance11.name .
nb_space Specify the number of blank space between each group of value associated to the connectors, signals or registers in the output
file. 0,1,2,3,4,5,6,7,8,9 or nothing.
format Specify the format that will be used to represent the value associated to the connectors, signals or registers. X for Hexadeci-
mal, O for Octal and B for Binary.
mode Specify the type of the connectors. IN for Input, OUT for Output, INOUT for Input/Output, SIGNAL for internal observing point,
REGISTER for register. IN, OUT, INOUT, SIGNAL, REGISTER are constants (defines) provided by genpat.
size Specify the size of the bused connectors : empty ("") for the scalar connectors, "nb1" for the numbered connectors, "nb1 TO nb2"
or "(nb1 TO nb2)" (nb1 < nb2), "nb1 DOWNTO nb2" or "(nb1 DOWNTO nb2)" (nb2 < nb1) for the vectors. Where nb1 and nb2 are integer.
option Specify options of the connector. "S" for a spied connector, empty ("") for a normal connector.
DESCRIPTION
Describes a set of connectors, signals or registers of the same format, size and mode.
EXAMPLE
DECLAR("a", ":2", "X", OUT, "3 DOWNTO 0", "S");
describes : a 3, a 2, a 1, a 0
format : Hexadecimal.
mode : Output.
option : Spied connector.
the group is separated of the others with 2 blank spaces.
result :
out a(3 downto 0) X spy ;;;
DECLAR ("toto", ":", "O", INOUT, "7 TO 11", "");
describes : toto 7, toto 8, toto 9, toto 10, toto 11.
format : Octal.
mode : Input/Output.
option : none.
the group is separated of the following with 0 blank space.
result :
inout toto(7 to 11) O ;
DECLAR ("ck", ":2", "B", IN, "", "");
describes : ck.
format : Binary.
mode : Input.
option : none.
the port is separated of the following with 2 blank spaces.
result :
in ck ;;;
DECLAR ("accu.f", ":", "B", SIGNAL, "", "S");
describes : accu.f .
format : Binary.
mode : Signal.
option : Spied connector.
the signal is separated of the following with 0 blank space.
result :
signal accu.f spy ;
DECLAR ("accu.reg", ":1", "B", REGISTER, "(3)", "");
describes : accu.reg .
format : Binary.
mode : Register.
option : none.
the signal is separated of the following with 1 blank space.
result :
register accu.reg(3) ;;;;
WARNING
The DECLAR function from the 4.0 release have a new parameter (option).
SEE ALSO
ARRAY(3), genpat(1), pat(5)
BUG REPORT
This tool is under development at the ASIM department of the LIP6 laboratory.
We need your feedback to improve documentation and tools.
ASIM
/LIP6 October 1, 1997 DECLAR(3)