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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T05:39:10+00:00 2026-06-13T05:39:10+00:00

I’m having trouble with the find command in bash. I’m trying to find a

  • 0

I’m having trouble with the find command in bash.
I’m trying to find a file that ends with .c and has a file size bigger than 2000 bytes. I thought it would be:

find $HOME -type f -size +2000c .c$

But obviously that isn’t correct.

What am I doing wrong?

  • 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-13T05:39:12+00:00Added an answer on June 13, 2026 at 5:39 am

    find $HOME -type f -name "*.c" -size +2000c

    Have a look to the -name switch in the mane page:

    -name pattern
                  Base of  file  name  (the  path  with  the  leading  directories
                  removed)  matches  shell  pattern  pattern.   The metacharacters
                  (`*', `?', and `[]') match a `.' at the start of the  base  name
                  (this is a change in findutils-4.2.2; see section STANDARDS CON‐
                  FORMANCE below).  To ignore a directory and the files under  it,
                  use  -prune; see an example in the description of -path.  Braces
                  are not recognised as being special, despite the fact that  some
                  shells  including  Bash  imbue  braces with a special meaning in
                  shell patterns.  The filename matching is performed with the use
                  of  the  fnmatch(3)  library function.   Don't forget to enclose
                  the pattern in quotes in order to protect it from  expansion  by
                  the shell.
    

    Note the suggestion at the end to always enclose the pattern inside quotes. The order of the options is not relevant. Have, again, a look to the man page:

    EXPRESSIONS
           The  expression  is  made up of options (which affect overall operation
           rather than the processing of a specific file, and always return true),
           tests  (which  return  a  true or false value), and actions (which have
           side effects and return a true or false value), all separated by opera‐
           tors.  -and is assumed where the operator is omitted.
    
           If the expression contains no actions other than -prune, -print is per‐
           formed on all files for which the expression is true.
    

    So, options are, by default, connected with and -and operator: they’ve to be all true in order to find a file and the order doesn’t matter at all. The order could be relevant only for more complicated pattern matching where there are other operators than -and.

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I've got a string that has curly quotes in it. I'd like to replace
In my XML file chapters tag has more chapter tag.i need to display chapters
I am trying to render a haml file in a javascript response like so:
I'm having trouble keeping the paragraph square between the quote marks. In firefox the
I'm trying to create an if statement in PHP that prevents a single post
I have a reasonable size flat file database of text documents mostly saved in
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example

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.