How to copy a file to multiple directories in Linux?

Aaron Lavers

Active member
Registered
Joined
May 20, 2016
Messages
67
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
Latest Threads
Replies
0
Views
38
Replies
0
Views
151
Replies
0
Views
187
Replies
0
Views
150
Recommended Threads
Replies
18
Views
12,626
Replies
6
Views
4,290
Replies
6
Views
5,033
Replies
6
Views
8,612
Replies
4
Views
2,180

Latest postsNew threads

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