S
S
sstars2017-06-18 15:50:01
linux
sstars, 2017-06-18 15:50:01

Finding and replacing a file?

How to find all files named file.txt in the /var/ folder and subfolders and replace them with the file /root/file-new.txt

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
pfg21, 2017-06-18
@pfg21

in addition to the previous

find /var/ -name 'file.txt' -exec cp /root/file.txt {}  \;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question