T
T
Tsarev Vadim2021-05-14 22:16:51
ubuntu
Tsarev Vadim, 2021-05-14 22:16:51

How to replace the line in the console in all files with the js extension?

Question for unix connoisseurs) there is a server on centos
How can I replace a string (search-replace) in all files with the js extension in a certain folder using the console, taking into account subfolders?
paths
var/www/html/site1/main.js
var/www/html/site2/main.js
var/www/html/site3/main.js and so on

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir Kuts, 2021-05-14
@zava75

find ./some_path -type f -name "*.js" -exec sed -i 's/foo/bar/' {} \;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question