How to copy a file to multiple directories in Linux?

Aaron Lavers

Member
Registered
Joined
May 20, 2016
Messages
61
Points
8
I know using cp command to copy a file to another folder in Linux but i want to copy a file to multiple directories at once time. Is it possible? how can I do this in just one command?
 

LJSHost

Well-known member
Hosting Provider
Registered
Joined
Jul 5, 2016
Messages
1,031
Points
63
Hi Aaron,

Try this

Code:
cat inputfile | tee /directory/outfile1 > /directory/outfile2  > /directory/outfile3
 
Newer Threads
Recommended Threads
Replies
4
Views
3,807
Replies
16
Views
5,567
Replies
6
Views
2,946

Latest Hosting OffersNew Reviews

Sponsors

Tag Cloud

You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an alternative browser.

Top