10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi, I'd like to ask if anybody can help improve my code to move 1 million+ files from a directory to another:
find /source/dir -name file* -type f | xargs -I '{}' mv {} /destination/dir
I learned this line of code from this forum as well and it works fine. However, file movement is kinda... (6 Replies)
Discussion started by: agentgrecko
6 Replies
2. UNIX for Dummies Questions & Answers
I have a tab-delimited inFile:
cat inFile
A B C D E F
1 2 3 4 5 6
a b c d e fI would like to replace the first 3 tabs in each row with underscore to get outFile:
A_B_C_D E F
1_2_3_4 5 6
a_b_c_d e fhow can I modify the following... (5 Replies)
Discussion started by: jdhahbi
5 Replies
3. Shell Programming and Scripting
In a directory I have many XML files, how to search for the string
<text>You are here</text> and replace it with
<text>YOU Are HERE</bc-text> in a unix command
find . -name "*.xml" (1 Reply)
Discussion started by: sandy1028
1 Replies
4. Shell Programming and Scripting
Hi All
I've file in which has these lines in it
create fil23456 read on 3345
create fil23456_1 read on 34567
create fil23456_2 read on 36789
I'm trying to replace the lines in such a way that in the end the file will look like
create fil23456 read on 3345
alter fil23456 read on... (3 Replies)
Discussion started by: Celvin VK
3 Replies
5. UNIX for Advanced & Expert Users
Hi All,
I have the file in the following format.I need to change the password "tomcat","admin","mgr" and "testing" in the file with the encrypted passwords.
The encrypted passwords are given to me by another script.
<?xml version='1.0' encoding='utf-8'?>
<tomcat-users>
<role... (22 Replies)
Discussion started by: nua7
22 Replies
6. UNIX for Dummies Questions & Answers
After running a command like
grep -ir files2/ *
This will find all the files that contain "files2/" in it.
For example if it finds
files2/dir/today
files2/dir/yesterday
files2/dir/2daysago
Now it may find 100 instances, so is there a quick find and replace command I can use? I... (4 Replies)
Discussion started by: NycUnxer
4 Replies
7. Shell Programming and Scripting
Hi
I need to find one string in all files and replace tht string with blank space and need to redirect all the files into the same directory again.
now i am using
find ./ -name "*.dmp" | xargs perl -pi -e 's/\\N//g' | sed 's/.$//g'
but now its not redirrecting properly .
its taking... (21 Replies)
Discussion started by: dbsurf
21 Replies
8. Shell Programming and Scripting
Hi
I am replacing some string occurances with empty string in all files under one directory using
find ./ -name "*.dmp" | xargs perl -pi -e 's/\\N//g' |
its taking too much time for replacing and redirecting to same file in the same directory.
Similarly afterwards i am finding last... (2 Replies)
Discussion started by: dbsurf
2 Replies
9. Shell Programming and Scripting
Hi,
There are some "n" files in a directory which contains comman string.A command to find and replace the string in all the files without looping.
like if i am in a directory :
# find ./ -name ".txt" | xargs sed -e 's/test/tst'
Upto here is performed correctly and i want to... (4 Replies)
Discussion started by: rakshit
4 Replies
10. UNIX for Dummies Questions & Answers
Hi
In our html pages, we have the image path as "/dir1/dir2/image.gif".
We are changing the location of the image directory.
So now we wish to do a global search and replace the path. I think we are having trouble with forward slash character.
Please help
Thanks in advance
Vikas
a... (3 Replies)
Discussion started by: vikas_j@hotmail
3 Replies