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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T17:36:15+00:00 2026-05-30T17:36:15+00:00

My find is not working the way I expected. When there is more than

  • 0

My find is not working the way I expected. When there is more than one file it halts with error.

hpek@melda:~/temp/test$ ll
total 16
-rw-r--r--  1 hpek  staff    70B Mar  2 15:16 f1.tex
-rw-r--r--  1 hpek  staff    70B Mar  2 15:17 f2.tex
hpek@melda:~/temp/test$ find . -name *.tex 
find: f2.tex: unknown option
hpek@melda:

and if I remove one of the files, then it works:

hpek@melda:~/temp/test$ rm f1.tex 
hpek@melda:~/temp/test$ find . -name *.tex 
./f2.tex
hpek@melda:~/temp/test$ 

It does not matter what file I remove. As soon as the wildcard gives more than one file, then find halts.

  • 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-30T17:36:16+00:00Added an answer on May 30, 2026 at 5:36 pm

    *.tex is expanded by bash before sent as argument to the command.

    find . -name *.tex
    

    is in your case equivalent to

    find . -name f1.tex f2.tex
    

    Solution: Put "..." around arguments with wildcards to avoid the shell expansion:

    find . -name "*.tex"
    

    This will work as expected:

    $ find . -name "*.tex"
    ./f1.tex
    ./f2.tex
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I searched a lot but could not find a way to dump table relations
Sorry for the length of this, but more info is usually better than not
I have not been able to find a way to cancel/terminate asynchronous read operation
Python 2.6 Using Python string.replace() seems not working for UTF-16-LE file. I think of
I could not find any pointers on how to create a menubar icon on
I could not find the function that returns the name of the cell referenced.
I could not find a clear answer to this question elsewhere, so I'll try
I can not find how to implement a design in C++. In the language
I did not find any suitable questions answered yet, so I'd like to know
I spent about hour and did not find any clue how to highlight my

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.