# How to copy very long(5000+ lines) out-put of commands to files

**URL:** <https://forum.ansible.com/t/how-to-copy-very-long-5000-lines-out-put-of-commands-to-files/23665>\
**Category:** Ansible Developer\
**Created:** [February 7, 2017, 2:41pm UTC](https://forum.ansible.com/t/how-to-copy-very-long-5000-lines-out-put-of-commands-to-files/23665 "2017-02-07T14:41:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Satish](https://avatars.discourse-cdn.com/v4/letter/s/aca169/32.png) [@Satish](https://forum.ansible.com/u/Satish)\
**Post date:** [February 7, 2017, 2:41pm UTC](https://forum.ansible.com/t/how-to-copy-very-long-5000-lines-out-put-of-commands-to-files/23665/1 "2017-02-07T14:41:53Z")

</div>

Hello Team,

I am using ios\_command module in a playbook. With this module we executes different commands (i.e. show version, show ISIS neighbor, show users etc…) on routers and collect respective output in text file. To copy out-put in a text file we use “copy” module. And whole playbook executed properly for all 58 commands except 2 commands.

These 2 commands have very long((5000+ lines)) output. Because of this playbook didn’t return output of these two commands.

**Can anyone support me to collect very long output in a text file.**

I am playing with the following Playbook ::

---

<div class="post-metadata">

**Author:** ![Andrew\_Latham](https://avatars.discourse-cdn.com/v4/letter/a/ed8c4c/32.png) [@Andrew\_Latham](https://forum.ansible.com/u/Andrew_Latham)\
**Post date:** [February 7, 2017, 5:11pm UTC](https://forum.ansible.com/t/how-to-copy-very-long-5000-lines-out-put-of-commands-to-files/23665/2 "2017-02-07T17:11:50Z")

</div>

This topic is likely better for the ansible-users list but on Cisco IOS use the ‘redirect’ to a txt file and grab it upon success of the ‘show’.

---

<div class="post-metadata">

**Author:** ![Satish](https://avatars.discourse-cdn.com/v4/letter/s/aca169/32.png) [@Satish](https://forum.ansible.com/u/Satish)\
**Post date:** [February 8, 2017, 8:27am UTC](https://forum.ansible.com/t/how-to-copy-very-long-5000-lines-out-put-of-commands-to-files/23665/3 "2017-02-08T08:27:26Z")

</div>

Hello Andrew,

Thank you for your reply.

I am not getting about ‘redirect’ can you please elaborate it.

Thanking you.

Regards,  
Satish.
