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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T14:01:27+00:00 2026-06-09T14:01:27+00:00

In Linux how do I use find and regular expressions or a similar way

  • 0

In Linux how do I use find and regular expressions or a similar way without writing a script to search for files with multiple “dots” but IGNORE extension.

For e.g search through the following files will only return the second file. In this example “.ext” is the extension.

testing1234hellothisisafile.ext
testing.1234.hello.this.is.a.file.ext

The solution should work with one or more dots in the file name (ignoring the extension dot). This should also work for any files i.e. with any file extension

Thanks in advance

  • 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-06-09T14:01:28+00:00Added an answer on June 9, 2026 at 2:01 pm

    So if I understand correctly, you want to get the filenames with at least two additional dots in the name. This would do:

    $ find -regex ".*\.+[^.]*\.+[^.]*\.+.*"
    ./testing.1234.hello.this.is.a.file.ext
    ./testing1234.hellothisisafile.ext
    $ find -regex ".*\.+[^.]*\.+[^.]*\.+[^.]*\.+.*"
    ./testing.1234.hello.this.is.a.file.ext
    

    The key dot detecting part is \.+ (at least one dot), coupled with the separating anything (but a dot, but the previous part covers it already; a safety measure against greedy matching) [^.]*. Together they make the core part of the regex – we don’t care what is before or after, just that somewhere there are three dots. Three since also the one from the current dir matters — if you’ll be searching from elsewhere, remove one \.+[^.]* group:

    $ find delme/ -regex ".*\.+[^.]*\.+[^.]*\.+[^.]*\.+.*"
    delme/testing.1234.hello.this.is.a.file.ext
    $ find delme/ -regex ".*\.+[^.]*\.+[^.]*\.+.*"
    delme/testing.1234.hello.this.is.a.file.ext
    

    In this case the result is the same, since the name contains a lot of dots, but the second regex is the correct one.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using Linux(Ubuntu), I am trying to find the files, but it is
On Linux, I often use grep with context to find usage information in man
Is there any linux command I could use to find out JAVA_HOME directory? I've
I need to find who locked a file using python (posix/linux). Currently I use
I'm trying to use mono to build a C# application for linux. But it
What command should I use to find the processor / chip architecture on Linux?
I use Linux's mount(2) function in a single-threaded process. But mounting of devices devices
I would like to use the linux command line tool ack but there is
I use linux screen heavily , generally if the OS didn't restart or say
I'm learning Objective-C using GNUstep(because I use Linux). I was thinking in create a

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.