# \-rprofile output

**URL:** <https://www.ruby-forum.com/t/rprofile-output/201731>\
**Category:** Ruby\
**Created:** [January 13, 2011, 3:09pm UTC](https://www.ruby-forum.com/t/rprofile-output/201731 "2011-01-13T15:09:45Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![luislavena](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/0ea827/32.png) [@luislavena](https://www.ruby-forum.com/u/luislavena)\
**Post date:** [January 13, 2011, 3:09pm UTC](https://www.ruby-forum.com/t/rprofile-output/201731/1 "2011-01-13T15:09:45Z")

</div>

I can’t figure out how to redirect -rprofile’s command output to a file.  
Every time it just outputs stuff from the program not from the profile.  
I’m asking this because it writes so much stuff that I can’t even scroll  
through it all so the most important things aren’t visible.

---

<div class="post-metadata">

**Author:** ![piotrs](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/ee59a6/32.png) [@piotrs](https://www.ruby-forum.com/u/piotrs)\
**Post date:** [January 13, 2011, 3:17pm UTC](https://www.ruby-forum.com/t/rprofile-output/201731/2 "2011-01-13T15:17:25Z")

</div>

On Thu, Jan 13, 2011 at 3:09 PM, Piotr S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I can’t figure out how to redirect -rprofile’s command output to a file.  
> Every time it just outputs stuff from the program not from the profile.  
> I’m asking this because it writes so much stuff that I can’t even scroll  
> through it all so the most important things aren’t visible.

You need to redirect stderr:

15:15:58 ~$ ruby19 -r profile -e ‘1000.times { 2 + 3 }’ 1\>/dev/null  
% cumulative self self total  
time seconds seconds calls ms/call ms/call name  
100.00 0.02 0.02 1 16.00 16.00 Integer#times  
0.00 0.02 0.00 1000 0.00 0.00 Fixnum#+  
0.00 0.02 0.00 1 0.00 16.00 #toplevel  
15:16:01 ~$ ruby19 -r profile -e ‘1000.times { 2 + 3 }’ 2\>/dev/null  
15:16:13 ~$

Cheers

robert

---

<div class="post-metadata">

**Author:** ![piotrs](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/ee59a6/32.png) [@piotrs](https://www.ruby-forum.com/u/piotrs)\
**Post date:** [January 13, 2011, 3:23pm UTC](https://www.ruby-forum.com/t/rprofile-output/201731/3 "2011-01-13T15:23:24Z")

</div>

thank you
