The question does not mention the Linux distribution, but the /usr/pgsql-10/bin path suggests RHEL-based. Because it is possible to have multiple versions of PostgreSQL installed on a single system, the alternatives program is used in RHEL-based distros for managing symbolic links from /usr/bin to utilities of a particular PostgreSQL version in /usr/pgsql-*/bin. Debian-based distros use the similar update-alternatives program.
List all installed alternatives:
$ alternatives --list
pgsql-pg_config auto /usr/pgsql-14/bin/pg_config
pgsql-createdb auto /usr/pgsql-14/bin/createdb
...
pgsql-psql auto /usr/pgsql-14/bin/psql
...
List alternatives for a specific program:
$ alternatives --display pgsql-psql
pgsql-psql - status is auto.
link currently points to /usr/pgsql-14/bin/psql
/usr/pgsql-14/bin/psql - priority 1400
Current `best' version is /usr/pgsql-14/bin/psql.
Select a different alternative:
$ sudo alternatives --config pgsql-psql
There is 1 program that provides 'pgsql-psql'.
Selection Command
-----------------------------------------------
*+ 1 /usr/pgsql-14/bin/psql
Enter to keep the current selection[+], or type selection number: