This command
chmod g-rx mydir/
removes read and execute permissions from group. It will leave intact any permissions for other (everyone), and write permissions for group.
It is different to:
chmod a-rx mydir/
chmod u+rx mydir/
Because a-rx impacts all three rights. It still leaves write permissions in place however for group or other.
The best way to do it is to set all permissions explicitly:
chmod 0700 mydir/
The 7 is binary for 111, where each bit represents read, write and execute respectively, at that position, refers to user (the file owner). The four positions in the 0700 refer to "special" permissions, user permissions, group permissions and other permissions respectively.
Use this to help translate between the number associated with rights, and the read, write, execute flags.
http://permissions-calculator.org/
chmod go-rwx-- group and other have no permissions. – glenn jackman Dec 18 '11 at 2:02