Find and Replace from files


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Find and Replace from files
# 1  
Old 07-21-2009
Find and Replace from files

Is there any command which I can apply from the command line to find and replace a particular text say "00:00:00:00" with "00" from all the files( where ever this text exists) of the current directory?

Thanks in advance
# 2  
Old 07-21-2009
Bumping up posts or double posting is not permitted in these forums.

Please read the rules, which you agreed to when you registered, if you have not already done so.

You may receive an infraction for this. If so, don't worry, just try to follow the rules more carefully. The infraction will expire in the near future

Thank You.

Proceed here:

https://www.unix.com/shell-programmin...#post302336265

The UNIX and Linux Forums.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Find all .sh files in file system and need to replace the string inside .sh files

Hi All, I need to write a script to find all "*.sh" files in /home file system and if any string find "*.sh" files with the name vijay@gmail.com need to replace with vijay.bhaskar@gmail.com. I just understood about the find the command to search .sh files. Please help me on this. find / -name... (3 Replies)
Discussion started by: bhas85
3 Replies

2. UNIX for Beginners Questions & Answers

Find and replace from multiple files

Hello everybody, I need your help. I have a php site that was expoited, the hacker has injected into many php files a phishing code that was discovered and removed in order to have again a clean code. Now we need to remove from many php files that malware. I need to create a script that find and... (2 Replies)
Discussion started by: ninocap
2 Replies

3. Shell Programming and Scripting

Find and replace in multiple files

Hi, I have php files in main dir and sub dir's as well. I need to find "new mysqli('localhost', 'System', 'xxxxxx', 'System', '3306');" and replace as "new mysqli('localhost', 'unx_sys', 'yyyy', 'unx_sys', '3306');" I tried like: sed 's/new mysqli\(*\)\;$/new... (1 Reply)
Discussion started by: ashokvpp
1 Replies

4. Shell Programming and Scripting

Find and replace folder of files with $var

I want to scan through all the files in the folder and replace all instances of $file_X within the file with the variable $X defined in my bash script on my debian 6.0 install. For example, if the file contains $file_dep I want it to be replaced with the value of the variable $dep defined in my... (1 Reply)
Discussion started by: Spadez
1 Replies

5. UNIX for Advanced & Expert Users

linux find and replace in multiple files

Is there a reason why all of these examples of linux find and replace in multiple files use find and grep to pipe into sed or perl. Why not just use sed or perl directly with something like this? sed -i 's/echo/burnbaby/g' booboo*... (2 Replies)
Discussion started by: cokedude
2 Replies

6. Shell Programming and Scripting

awk find and replace in multiple files

Hi I use the following code to replace ‘.' with ‘N' in my files and keep both versions. awk '{ gsub(/\./,"N"); print }' file_0001.txt > path/to/new/dir/file_0001.txt I need help on how to apply the code to 100 files instead of doing them one file at a time. The files are labeled... (7 Replies)
Discussion started by: jdhahbi
7 Replies

7. Shell Programming and Scripting

find and replace three lines in files?

Hello, i usually use this for one tag or line: find . -type f -exec replace "whatever goes here" "" -- {} \; but i want to replace three lines in a file for example this: <script language=javascript>< ... (1 Reply)
Discussion started by: Bashar
1 Replies

8. UNIX for Dummies Questions & Answers

Find and replace a string in multiple files

I used the following script cd pathname for y in `ls *`; do sed "s/ABCD/DCBA/g" $y > temp; mv temp $y; done and it worked fine for finding and replacing strings with names etc. in all files of the given path. I'm trying to replace a string which consists of path (location of file) ... (2 Replies)
Discussion started by: pharos467
2 Replies

9. UNIX for Dummies Questions & Answers

how find and replace into different files

Hi, I have a serie of files in a directory. Into this files I´ve got lines with a serie of numbers like "12344332","1","2","3","4","5","6","7","3","7","7","8","3","7" I need make some changes on the line where is a specific string, for example numberToIdentify = "12344332". And once... (1 Reply)
Discussion started by: ran
1 Replies

10. UNIX for Dummies Questions & Answers

find pattern in FILES and replace it ??

Hi How can I looking for a pattern found in more than one file and replace it with anther pattern this what I was used: find . -name "account.adrs" -depth -follow -exec grep -l "Email = ;" {} \; this print the files name -which is account.adrs- and its path -which is deferent for each... (4 Replies)
Discussion started by: tamer
4 Replies
Login or Register to Ask a Question