Q:

shell linux unix xargs -i replace string

I have hard time understanding the xargs part of this command : 
find -type f | sed 's/ /\\ /g' | xargs -ifil file fil | \
   grep ELF | grep executable | cut -d: -f1 | xargs -ifil find fil -exec chmod 744 {} \;

What I have understood: looking for file not directory, then replacing "  " by "\ ", then give the output to xargs that will pass it to the command file? why using the -i to replace? Then grep ELF and executable, take the first column by using : delimeter, do again an xargs with the same options to chmod 744 ?

A:

Well, -istr is a (deprecated) alternative for -I str, and the GNU man page tells what -I does:
-I replace-str
      Replace  occurrences  of  replace-str  in the initial-arguments with 
      names read from standard input.  Also, unquoted blanks do not termi‐
      nate  input  items;  instead the separator is the newline character. 
      Implies -x and -L 1.

In other words, with -ixxx (or -Ixxx), xargs replaces the string xxx in the command given with the current item before running the command, and also makes xargs run the given command once for each input line, instead of the default where it stacks multiple items to a single command invocation, and considers whitespace-separated strings as distinct items.
E.g. here, the echo command runs twice, with xxx replaced by the contents of the two input lines as appropriate:
$ printf "foo bar\nqwerty\n" | xargs -ixxx echo ":xxx:xxx:"
:foo bar:foo bar:
:qwerty:qwerty:

