Find the answer to your Linux question:
Results 1 to 3 of 3
Hi, I'm wondering if these is some way I can search all the files on the computer for the word 'want' and replace each instance with the words 'like'. This ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Apr 2006
    Posts
    5

    want to like


    Hi,

    I'm wondering if these is some way I can search all the files on the computer for the word 'want' and replace each instance with the words 'like'.

    This is a personal idiocentristy, the word want generally makes me feel disturbed and I feel less used and offended when I see the word like.

    I'm geussing something like grep can be used but I'm pretty novice with grep.

    any hints or suggestions on how I may be able to do this?

  2. #2
    Linux Guru Cabhan's Avatar
    Join Date
    Jan 2005
    Location
    Seattle, WA, USA
    Posts
    3,252
    This may work:
    Code:
    find ~/ -exec sed -ie 's/\bwant\b/like/' {} \;
    This will start in your home directory, find every occurrence of the word 'want' in every file, and replace it with like.

    Beware that running this on source code of any sort is a bad idea, as it can possibly break things.

  3. #3
    Just Joined!
    Join Date
    Apr 2006
    Posts
    5
    Quote Originally Posted by Cabhan
    This may work:
    Code:
    find ~/ -exec sed -ie 's/\bwant\b/like/' {} \;
    This will start in your home directory, find every occurrence of the word 'want' in every file, and replace it with like.

    Beware that running this on source code of any sort is a bad idea, as it can possibly break things.
    thanks..

    now I'm wondering if I should do it. I actually was also thinking about prohibiting the frase from being saved or used, like censoring the word. Like running a check on all new files for the phrase then automatically changing the word or 'quarentining the file.

    I'm geussing this would have other appications for box security. Like using the same code for 'any code segments' that could cause issues.

    off topic a bit.

    So if I did have issues.. I could just reverse the word order then I assume to change it back.



    gracias

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •