# Output from "top" in shell module does not display the entire "COMMAND" column string

**URL:** <https://forum.ansible.com/t/output-from-top-in-shell-module-does-not-display-the-entire-command-column-string/38230>\
**Category:** Ansible Project\
**Created:** [July 15, 2023, 12:40pm UTC](https://forum.ansible.com/t/output-from-top-in-shell-module-does-not-display-the-entire-command-column-string/38230 "2023-07-15T12:40:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Luiz\_Gustavo](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/luiz_gustavo/32/4846_2.png) [@Luiz\_Gustavo](https://forum.ansible.com/u/Luiz_Gustavo)\
**Post date:** [July 15, 2023, 12:40pm UTC](https://forum.ansible.com/t/output-from-top-in-shell-module-does-not-display-the-entire-command-column-string/38230/1 "2023-07-15T12:40:23Z")

</div>

Hello,

ansible   
-i \<inventory\_file\>   
-m shell   
-a “top -b -n 1 -d 1”   
-K -b --become-user=root

Look at pid 4 where the result is “rcu\_par\*\*+\*\*” and should be “rcu\_par\_gp”. Why?:

# ansible output:

| CHANGED | rc=0 \>\>  
… \<\>  
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND  
1 root 20 0 245612 11128 8084 S 0.0 0.3 21:04.17 systemd  
2 root 20 0 0 0 0 S 0.0 0.0 0:18.99 kthreadd  
3 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 rcu\_gp  
4 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 **rcu\_par+**  
… \<\>

While running on the host it displays:

… \<\>  
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND  
1 root 20 0 245612 11128 8084 S 0.0 0.3 21:04.18 systemd  
2 root 20 0 0 0 0 S 0.0 0.0 0:18.99 kthreadd  
3 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 rcu\_gp  
4 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 **rcu\_par\_gp**  
… \<\>

---

<div class="post-metadata">

**Author:** ![utoddl](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/utoddl/32/249_2.png) [@utoddl](https://forum.ansible.com/u/utoddl)\
**Post date:** [July 18, 2023, 2:53am UTC](https://forum.ansible.com/t/output-from-top-in-shell-module-does-not-display-the-entire-command-column-string/38230/2 "2023-07-18T02:53:44Z")

</div>

Output width. Your output is being truncated at the default 80 columns.  
Add, say “-w 180” to your top parameter list.  
(Also, top doesn’t require --become; any id can run top.)

Cheers,

---

<div class="post-metadata">

**Author:** ![Luiz\_Gustavo](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/luiz_gustavo/32/4846_2.png) [@Luiz\_Gustavo](https://forum.ansible.com/u/Luiz_Gustavo)\
**Post date:** [July 18, 2023, 9:48am UTC](https://forum.ansible.com/t/output-from-top-in-shell-module-does-not-display-the-entire-command-column-string/38230/3 "2023-07-18T09:48:14Z")

</div>

Thanks Todd, it worked perfectly.

Taking advantage of the subject, do you know any similar command in AIX (would it be topas?). I can’t run it in the background.
