Today, while maintaining the Oracle database, view the status of the listener and execute
#lsnrctl status
Error:-bash:lsnrctl:command not found. Not before, think carefully, the problem found, I was rooted telnet to the server, the maintenance of Oracle, direct Su Oracle, so that although the user switch to Oracle, environment variables are still root environment variables, it will be reported environment variable error, The correct command is su-oracle, so the environment variable is also switched to the environment variable of Oracle.
Take a look at the man page of the SU command
NAME
Su-run a shell with substitute user and group IDs
Synopsis
Su [OPTION] ... [-] [USER [ARG] ...]
DESCRIPTION
Change the effective User ID and group ID.
USER.
-,-L,--login
Make the shell a login shell, clears all envvars
Except for term, initializes HOME, SHELL, USER,
LOGNAME and PATH
...
A mere-implies-l. If USER not given, assume root.
As you can see, the Add-option will empty the environment variables except for the term and reinitialize home, SHELL, USER, logname, and path.
So pay attention to details, especially under Linux, a little bit differently, all of which can lead to completely different results.
Invalid Oracle environment variable under Linux