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 6877061
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T04:33:16+00:00 2026-05-27T04:33:16+00:00

How do I write a sed invocation to output only lines containing only numbers

  • 0

How do I write a sed invocation to output only lines containing only numbers consisting of a repeated single digit (and containing at least two digits).

Example:

seq 1000 | sed ...

For which the output should be:

11
22
33
44
55
66
77
88
99
111
222
333
444
555
666
777
888
999
  • 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-27T04:33:17+00:00Added an answer on May 27, 2026 at 4:33 am

    if sed is your favorite, here you go:

    kent$  seq 1000|sed -nr '/^([0-9])\1+$/p'
    11
    22
    33
    44
    55
    66
    77
    88
    99
    111
    222
    333
    444
    555
    666
    777
    888
    999
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How can I get sed to extract the lines between two patterns, write that
I want to write a Shell (AWK, Sed also fine) program to take as
I need to write multiple sed script files. I can't seem to find a
I saw the sed examples, but no matter how I write that it won't
Sometimes the good old tools still work best. In sed, I could write things
I have two (UNIX) programs A and B that read and write from stdin/stdout.
i'm trying to write a grep/sed/awk for a condition from a file, and at
Trying to write a regex matcher for roman numerals. In sed (which I think
I'm looking to write a single makefile that calls a target in it itself
Basically I'm trying to write a clever single line of commands that outputs base64

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.