# cat command

**URL:** <https://community.unix.com/t/cat-command/190086>\
**Category:** UNIX for Advanced & Expert Users\
**Created:** [March 24, 2008, 3:28am UTC](https://community.unix.com/t/cat-command/190086 "2008-03-24T03:28:39Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![tkbharani](https://community.unix.com/user_avatar/community.unix.com/tkbharani/32/3554_2.png) [@tkbharani](https://community.unix.com/u/tkbharani)\
**Post date:** [March 24, 2008, 3:28am UTC](https://community.unix.com/t/cat-command/190086/1 "2008-03-24T03:28:39Z")

</div>

Dear All

```
   I have two text files File1.txt and File2.txt . I am concatenating the two files and making it as single file Cat_File.txt. Now i need to keep joined file in two different path. that is I need to use cat command only once ,but store joined file in two different locations. Since file size is huge, I trying to avoid second cat or move or copy.

```

Command used for cat  
-----------------------  
cat File1.txt File2.txt \> /file\_path/Cat\_File.txt

---

<div class="post-metadata">

**Author:** ![sank](https://community.unix.com/letter_avatar/sank/32/6_22734026db12803ebb3e059622ac3534.png) [@sank](https://community.unix.com/u/sank)\
**Post date:** [March 24, 2008, 3:58am UTC](https://community.unix.com/t/cat-command/190086/2 "2008-03-24T03:58:40Z")

</div>

> [@tkbharani](#):
>
> Dear All
> 
> I have two text files File1.txt and File2.txt . I am concatenating the two files and making it as single file Cat\_File.txt. Now i need to keep joined file in two different path. that is I need to use cat command only once ,but store joined file in two different locations. Since file size is huge, I trying to avoid second cat or move or copy.
> 
> Command used for cat  
> -----------------------  
> cat File1.txt File2.txt \> /file\_path/Cat\_File.txt

may be, you can try:  
cat File1.txt File2.txt | tee file\_path1/Cat\_File.txt \> file\_path2/Cat\_File.txt

---

<div class="post-metadata">

**Author:** ![krishmaths](https://community.unix.com/letter_avatar/krishmaths/32/6_22734026db12803ebb3e059622ac3534.png) [@krishmaths](https://community.unix.com/u/krishmaths)\
**Post date:** [March 24, 2008, 4:02am UTC](https://community.unix.com/t/cat-command/190086/3 "2008-03-24T04:02:48Z")

</div>

You can use tee to achieve this as below.

```nohighlight
cat infile1 infile2 | tee outfile1 > outfile2

```

---

<div class="post-metadata">

**Author:** ![vikrant\_poman](https://community.unix.com/letter_avatar/vikrant_poman/32/6_22734026db12803ebb3e059622ac3534.png) [@vikrant\_poman](https://community.unix.com/u/vikrant_poman)\
**Post date:** [July 21, 2008, 9:10am UTC](https://community.unix.com/t/cat-command/190086/4 "2008-07-21T09:10:10Z")

</div>

Hi

You can use following command  
cat a b \> /root/c  
This will copy all the data in both the files a and b into the file c..  
If file c is not present the this command will make it and append data into it...
