Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

524
Visualizações
linux command to find files and replace with another file

I'm looking for a linux command to search a folder directory and it's subfolders for a file by name and replace all of them with a copy of another file. Any idea?

over 4 years ago · Santiago Trujillo
2 Respostas
Responde à pergunta

0

Assuming you have the replacement file in your home directory (~), you can use find to do the replacing. This will find all boom.txt files and replace them with the replace.txt file (keeping the boom.txt name).

find . -name "boom.txt" -exec cp ~/replace.txt {} \;
over 4 years ago · Santiago Trujillo Relatório

0

Adding to the answer by user1683793, the following command can also be an alternative for the copy and replace. This command is verified on Mintty(Windows 10).

find . -name "boom.txt" -print -exec cp ~/replace.txt {} \;
over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda