How can i remove "" string from all 30 files in my directory through linux / unix command?
Asked
Active
Viewed 33 times
0
-
possible duplicate of [Delete a line containing a specific string using sed](http://stackoverflow.com/questions/5410757/delete-a-line-containing-a-specific-string-using-sed) – GHajba Jul 24 '15 at 07:12
-
see, I'm new in LINUX so i don't know how to delete it! can you please help me? #GHajba – Krunal Patel Jul 24 '15 at 07:13
-
Read the answer of the related question I linked in the comment. Then you will see the how to delete the line. Not searching for an answer and asking a question is a very bad habit. – GHajba Jul 24 '15 at 07:29
2 Answers
0
if you want to keep the old files unmodified you can use this command : sed -i.backup -e 's/stringtobemodified//g' * && mkdir unmodified && mv *.backup unmodified
if you run that chain command it will modify all files as you wanted and create a new directory named "unmodified" and it will save a copy of each file with the extension .backup and it will move the backup files to the "unmodified" directory

Robert
- 1
- 2
-
That's a good answer -- just be careful of the formatting. Use \`backticks\` around commands not just for a nicer look, but also to escape the Markdown/HTML meaning of characters inside your command. Right now it looks like you're suggesting the sed script 's///g' which I'm sure is not what you mean! – RJHunter Jul 24 '15 at 09:12