=?utf-8?q?PG_Bug_reporting_form?= <noreply@postgresql.org> writes:
> sudo -u shahid ./pg_ctl -D /root/pgsql10x/data/ initdb
> invalid binary "/root/pgsql10x/bin/pg_ctl"
I think you would get that error if pg_ctl is unable to stat itself,
which might be due to a permissions problem. Are you sure the shahid
user can read/exec all the directories in that path (particularly /root)?
regards, tom lane