10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
Hi All,
I hope somebody would be able to help me.
I would need to search a string coming from a file, example file.txt:
dog
cat
goat
horse
fish
For every string, I would need to know if there are any files inside a directory(recursively) that contains the string regardless of case.... (9 Replies)
Discussion started by: kokoro
9 Replies
2. Shell Programming and Scripting
Hi,
How can I use find command to search string/pattern in a file recursively?
What I tried:
find . -type f -exec cat {} | grep "make" \;
Output:
grep: find: ;: No such file or directory
missing argument to `-exec'
And this:
find . -type f -exec cat {} \; -exec grep "make" {} \;... (12 Replies)
Discussion started by: cola
12 Replies
3. Shell Programming and Scripting
Hi all,
I wanted to find and replace an email id from entire directory structure on a Linux server. I found that find . -type f -print0 | xargs -0 sed -i 's/abc@yahoo.com/xyz@gmail.com/g' would do it perfectly.
But my search criteria has extended and now I want to search for a string1 like... (2 Replies)
Discussion started by: pat_pramod
2 Replies
4. Shell Programming and Scripting
Hi in a directory i've files having the following name
for_category_info_19990101984301
for_catgry_meta_19991111214601
-------
I just want the name till year and month i.e;
for_category_info_199901
for_catgry_meta_199911
How can i achieve the above string
Thanks (2 Replies)
Discussion started by: smile689
2 Replies
5. Shell Programming and Scripting
I need to cut all the Strings in one file and Paste it in the another file in the Specific line by replacing the specific String. For Example
Step 1: From the newfile.txt, i need to copy all the strings
newfile.txt
How are you, I am fine, How is your work
newfle2.txt
Hello david,... (2 Replies)
Discussion started by: Padmanabhan
2 Replies
6. UNIX for Advanced & Expert Users
i have a file named keyword.csv(contains around 8k records) which contains a no. of columns.
The 5th column contains all the keywords.
I want to recursively search these keywords in all .pl files(around 1k) and display the filename....Afterthat i will use the filename and some of the column from... (3 Replies)
Discussion started by: millan
3 Replies
7. Shell Programming and Scripting
Hi,
I want a help in this forum for my below issue.
1. I have a file where I'm searching for a text .
2. When I get the line where the above string is present I want to cut
some texts from the line where the particular string was found.
These above two steps will repeat in the... (2 Replies)
Discussion started by: bhaski2012
2 Replies
8. Shell Programming and Scripting
Hi ,
I have a directory structure as dir and subdirectories and files under it and so on.now I need to find the files which contain the search string under every dir and subdir and replace .
my search string is like
searchstring=/a/b
string to be replaced=/a/c/b
please help.
... (7 Replies)
Discussion started by: mohanpadamata
7 Replies
9. Shell Programming and Scripting
Hello All,
Plz help me with:
I have a csv file with data separated by ',' and optionally enclosed by "". I want to check each of these values to see if they exceed the specified string length, and if they do I want to cut just that value to the max length allowed and keep the csv format as it... (9 Replies)
Discussion started by: ozzy80
9 Replies
10. Shell Programming and Scripting
I need a script that will replace all occurances of a string in all filenames and foldernames, recursively.
Right now I have this script:
for f in `find -name *eye*`; do
echo processing $f
g=`expr "xxx$f" : 'xxx\(.*\)' | tr 'eye' 'm'`
mv "$f" "$g"
done
The problem is that tr... (2 Replies)
Discussion started by: TheMJ
2 Replies