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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T03:20:15+00:00 2026-05-25T03:20:15+00:00

I want to search with grep for a string that looks like this: something

  • 0

I want to search with grep for a string that looks like this:

something ~* 'bla'

I tried this, but the shell removes the single quotes. Argh…

grep -i '"something ~* '[:alnum:]'"' /var/log/syslog

What would be the correct search?

  • 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-25T03:20:15+00:00Added an answer on May 25, 2026 at 3:20 am
    grep -i "something ~\* '[[:alnum:]]*'" /var/log/syslog
    

    works for me.

    • escape the first * to match a literal * instead of making it the zero-or-more-matches character:
      ~* would match zero or more occurrences of ~ while
      ~\* matches the expression ~* after something
    • use double brackets around :alnum: (see example here)
    • use a * after [[:alnum::]] to match not only one character between your single quotes but several of them
    • the single quotes don’t have to be escaped at all because they are contained in an expression that is limited by double quotes.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Say our folder structure looks like this: /app /app/data ... /app/secondary /app/secondary/data I want
I want to search for files containing DOS line endings with grep on Linux.
I want to search a directory for all files that match a certain pattern.
I want to search the program >> that is by which you append to
how to modify this code if i want search JD from var str=KD-S35JWD ..i
I want to search and replace string located in a several files via bash
If I run grep -i echo * I get the results I want, but
I want to search the commit messages for a string, it's easy to pipe
I wrote a shell script that lets me grep through a directory tree and
I want search those rows that do not contain rajasthan in the state field

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.