2

I'm trying to locate all files on my system matching an SELinux file context (fcontext).
These contexts are specified using some regex, and I'd like to use find -regex ... to the same effect.
However, find has several types of regex:

  • emacs (default)
  • posix-awk
  • posix-basic
  • posix-egrep
  • posix-extended

I tried looking at the source of policycoreutils (apt-get source policycoreutils) but didn't see which regex is being used.
I guess "The differences are minute and nothing to obsess about" is also an answer.

  • Are you asking what regex SELinux uses or how to translate a specific regex to make it work with find? – terdon Mar 2 '15 at 11:05
  • What regex SELinux uses. I hope I won't have to translate anything – Nitz Mar 2 '15 at 13:03
  • OK, I'm just trying to understand how find comes into it. The most widespread regex flavor is the BRE (posix-basic for find) so that's your best bet. – terdon Mar 2 '15 at 13:11
  • Going by examples, they're ERE or close enough, so posix-egrep or posix-extended (between which the differences are minute). – Gilles Mar 2 '15 at 20:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.