There's a couple of shell syntax to go over for you to fully understand.
The pipe | (located above the return key and is part of the backslash key) character is used to redirect the output of one command as input to another. Google shell pipe commands for solid examples.
The backtick ` (located above the tab key and is part of the tilde key ~) uses the output of a command as input in the middle of another command. The command within the backticks is evaluated first and then the overall command. Google shell backticks or see the following for an easy example.
Code:
echo 127.0.0.1
ping 127.0.0.1 -n 4
ping `echo 127.0.0.1` -n 4
Explanation of command
Original command
Code:
grep :`grep ^mygroup /etc/group | cut -d: -f3`: /etc/passwd
The first command executed is:
Code:
grep ^mygroup /etc/group
Grep outputs all lines which start with "mygroup" (^ means start with, read grep man page) from the file /etc/group. Lets say for example the output of that grep command is:
Code:
mygroup:S-1-5-32-545:545:
Now lets evaluate the code within the backticks as a whole.
Code:
grep ^mygroup /etc/group | cut -d: -f3
Cut will take the output of grep and chop it up using a colon : as a delimiter ( -d: ) and takes the 3rd field from the left ( -f3 ). So the output of the full command will be:
Now lets replace the backticks with the output of the commands within the backticks and the command may make a little more sense.
Code:
grep :545: /etc/passwd
Now I don't know if the final result of your command outputs anything but it doesn't in mine (I used a group found on my own system and still output nothing).
That's exactly how the shell code is acting. What're you using it for? Just curious.
Like malekmustaq stated, reading the man pages will clear all the command behavior up and tell you what the arguments are doing.