Sed replace all files




















Active 9 months ago. Viewed k times. I run this command to find and replace all occurrences of 'apple' with 'orange' in all files in root of my site: find. What is wrong with this command? Here are some lines of output of find. And the directory strucuture please. Hm your find is correct, works for me with subdirs. How do you know it does not process subdirectories? Show 4 more comments. Active Oldest Votes.

Your find should look like that to avoid sending directory names to sed : find. Philippe Fanaro 3, 1 1 gold badge 24 24 silver badges 53 53 bronze badges. Actually adding -e does not work on Mac OS. For Mac OS, this answers stackoverflow.

Show 2 more comments. Julius Julius 1, 1 1 gold badge 8 8 silver badges 7 7 bronze badges. Thanks for this answer, it was very helpful! Add a comment. This method is better though and is still working for me on This worked for me: find.

Billal Begueradj Sukrant Sukrant 9 2 2 bronze badges. Sign up or log in Sign up using Google. Sign up using Facebook. Sign up using Email and Password. Post as a guest Name. Martin Pecka 2, 1 1 gold badge 27 27 silver badges 35 35 bronze badges. I get No such file or directory with this one and recursive directories. Dennis Williamson Dennis Williamson k 87 87 gold badges silver badges bronze badges. I know I'm really late but still: find. Unheilig Ziyad Ziyad 1 1 silver badge 7 7 bronze badges.

Best answer here. Don't know about useless - but its a very ugly approach, then there's the fact that using fixed temporary file name files. Sign up or log in Sign up using Google. Sign up using Facebook. Sign up using Email and Password.

Post as a guest Name. Email Required, but never shown. The Overflow Blog. Stack Gives Back Safety in numbers: crowdsourcing data on nefarious IP addresses. Featured on Meta. New post summary designs on greatest hits now, everywhere else eventually. Linked Related Hot Network Questions. Question feed. Stack Overflow works best with JavaScript enabled. Accept all cookies Customize settings.



0コメント

  • 1000 / 1000