Recently when we migrated our old code in Android to API level 30 i.e. androidx , lots of headers files got changed, whereas all the other backword compatible code remained same.
So to accomplish this migration, we have to rename the header imports to androidx imports, but changing all those thousands of source files manually was simply not possible.
But this finding and replacing the string from source code without opening files can be done using single command in Linux terminal as,
$ cd your_source
Once you run this, all occurrences of “old_string” will get replaced with “new_string” in your complete source code.