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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T16:23:51+00:00 2026-06-12T16:23:51+00:00

I want to check whether a file on Linux has permission 555, but the

  • 0

I want to check whether a file on Linux has permission 555, but the file has a 755 permission instead.
So I do a boolean AND in my program:

if ((perm_of_file && perm_required) == 555)

i.e. (755 && 555 == 555)

Should this evaluate to true?
I know this is not intuitive from a programming prospective and the real background question is:
Is 755 considered as a “member” of the 555 permission group?

What I tried:
I use find -perm 555 on Linux and it doesn’t list those files who has 755 permission, so I am guessing the answer to the question is NO?

If somebody can help me answer or rephrase this question, that would be very helpful.
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-12T16:23:52+00:00Added an answer on June 12, 2026 at 4:23 pm
    • ((file_mode && some_bits) == some_bits) # is logical and, you need bitwise and
    • ((file_mode & some_bits) == some_bits) # is bitwise and
    • file modes are (still) expressed in octal notation, in most C-like languages you’ll need to add a leading zero to indicate octal mode
    • command-line programs (such as chmod or find) don’t need the leading zero, they expect the numerical mode-string to be octal
    • find . -mode xxx # finds files with exactly the mode xxx
    • find . -mode -xxx # finds files with at least the mode bits xxx set
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to check in linux bash whether a file was created more than
I want to check whether any Zip file is present on a specified path.
I want to check whether a given file exists in android sd card. I
I want to check whether a string is a file name (name DOT ext)
I have a file called diff.txt . I Want to check whether it is
I want to check whether the loggedIn user has liked a specified page or
My upload form expects a tar file and I want to check whether the
I want to Check whether a NSF file is Encrypted or not (using C#).
trying to check whether the file I want to read exists or not.
I am trying to check whether an #include <file.h> has already been declared using

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.