Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

517
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda