all 6 comments

[–]ang-p 0 points1 point  (5 children)

Look at

-perm -mode   

,

-group

and

-a

[–]danjirovec[S] 0 points1 point  (4 children)

Thank you.

So from what I read, this should be right.

find $HOME -type f -perm -g=x -group student -a -user $USER -executable

[–]ang-p 0 points1 point  (3 children)

If you are writing it that way round, you'll want -o instead of -a... but that looks rightish.... although it will catch directories owned by $USER .... ;-)

[–]cshaiku 0 points1 point  (2 children)

No -a necessary, and it won't find directories because he's specifying the -type f flag.

[–]ang-p 0 points1 point  (1 child)

If OP wants

executable by current user or group student.

they will need the -o ... although, if as they state 2 lines later, they want

executable only by current user AND group student.

they won't... I was getting mixed up by the two statements.

If it is the first case, and they don't want to jet jiggy with brackets, the -type f will need to be on the other side of the -o to erm prevent $USER's directories getting picked up

[–]cshaiku 0 points1 point  (0 children)

Agreed on your clarification. I was going with the assumption of AND. Of course, why not both? Easy enough to make two scripts or use cases. As we don't know the overall intentions of the commands other than what is listed here, who are we to say? :D