Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6213353
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T06:40:51+00:00 2026-05-24T06:40:51+00:00

In shell, I can do $ cat name_of_file_with_a_lot_of_text | grep What I am looking

  • 0

In shell, I can do

$ cat name_of_file_with_a_lot_of_text | grep "What I am looking for"

Inside the Rails Console, can I achieve something similar, say when I run a command and the output is huge, especially say a DB query.

I am aware of outputting it as YAML but that Is not what I am looking for.

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T06:40:52+00:00Added an answer on May 24, 2026 at 6:40 am

    Yes, you can. The method is called gr… wait for it …ep. Ruby’s grep works on String, Array and many other built-in objects. For example to get all to_xxx methods of a number, just do:

     1.methods.grep(/to_/)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

how can I provide feedback for a shell command that may run for quite
How can I invoke a shell command from python which includes regexp (i.e., cat
How can I run a shell script in Mac Os X at a certain
How can I intermittently show my history command number in my shell prompt? For
In the Erlang interactive shell you can bind variables to values. If I would
If 48x48 or 64x64 icons are present in the Vista Shell how can you
How can you invoke shell commands from Squeak and Pharo? Do these environments have
How can I tell what mode the shell is in, from within the shell?
How can I execute a.exe using the Cygwin shell? I created a C file
How can I copy and paste in irb (Interactive Ruby Shell) on Windows?

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.