0

enter image description here

I'm just curious to know what that extra hyphen does in the second command, compared to the first command.

1

It's in the manual page:

   -perm -mode                                                              
          All of the permission bits mode are set for the file.   Symbolic  
          modes  are accepted in this form, and this is usually the way in  
          which would want to use them.  You must specify `u', `g' or  `o'  
          if  you use a symbolic mode.   See the EXAMPLES section for some  
          illustrative examples.

And also in POSIX:

-perm [-]mode
The mode argument is used to represent file mode bits. It shall be identical in format to the symbolic_mode operand described in chmod, and shall be interpreted as follows. To start, a template shall be assumed with all file mode bits cleared. An op symbol of '+' shall set the appropriate mode bits in the template; '-' shall clear the appropriate bits; '=' shall set the appropriate mode bits, without regard to the contents of the file mode creation mask of the process. The op symbol of '-' cannot be the first character of mode; this avoids ambiguity with the optional leading <hyphen-minus>. Since the initial mode is all bits off, there are not any symbolic modes that need to use '-' as the first character.

| improve this answer | |

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.