ML
    • Recent
    • Categories
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    Bulk Edit Files

    IT Discussion
    3
    4
    709
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • A
      Alex Sage
      last edited by Alex Sage

      I have a website built 100% out of htm files.

      We have moved the site from domain1.com to domain2.com but some links are still pointing to domain1.com.

      What command can I use in linux to search all the files, and find/replace.

      Seems like a easy command for @scottalanmiller 😉

      There all in one directory, but there is sub directory's. Want to look at all files and sub directory's.

      Aaron

      scottalanmillerS 1 Reply Last reply Reply Quote 0
      • scottalanmillerS
        scottalanmiller @Alex Sage
        last edited by

        @aaronstuder said:

        I have a website built 100% out of htm files.

        We have moved the site from domain1.com to domain2.com but some links are still pointing to domain1.com.

        What command can I use in linux to search all the files, and find/replace.

        Seems like a easy command for @scottalanmiller 😉

        There all in one directory, but there is sub directory's. Want to look at all files and sub directory's.

        Aaron

        Search all the files is find, to do the replacing in them is sed

        1 Reply Last reply Reply Quote 1
        • scottalanmillerS
          scottalanmiller
          last edited by

          So you would use find and -exec into sed.

          1 Reply Last reply Reply Quote 1
          • larsen161L
            larsen161
            last edited by

            A very detailed answer with examples can be found over on unix.stackexchange: How can I replace a string in a file(s)?

            1 Reply Last reply Reply Quote 1
            • 1 / 1
            • First post
              Last post