As the glob (pathname) expansion is done first by the shell before the chown
runs, the glob pattern *
is expanded to all files in the current directory first and chown
is getting those as its options and arguments. You have a file in the current directory that starts with -i
, hence chown
is considering it as an option, not as an argument (filename).
You need to use --
to indicate the end of options for chown
:
chown -R myuser:mygroup -- *
Or precede the glob pattern (*
) with ./
to explicitly indicate it as argument:
chown -R myuser:mygroup ./*
chown -R myuser:mygroup ./*