command not found
Dear all,
It is weird when i su - <username> it shows [root@virtual ~]# su - <username> -bash: [<username>: command not found [root@virtual ~]# I need the explanation to furnish my knowledge TQ |
Quote:
EDIT Quote:
What command did you use to log in root ? |
I think the explanation is that you are supposed to replace <username> with an actual username, such as root. However, in the example you give, I see the # sign at your prompt, and the name 'root@host' in your prompt, which means (usually) that you are already the root user, and should probably put some other username there instead.
As Anish implied, when asking questions, the more information you provide, the better! :) At the very very least, it helps to know what Linux you are running, in case the suggestions to help you might vary from one OS to another. Sasha |
[root@icbavirtual ~]# su - oradb
-bash: [oradb: command not found [oradb@icbavirtual ~]$ |
Try just su oradb
|
or sudo -u oradb bash
|
Quote:
|
What is the output of
Code:
alias su |
this is the output
[root@icbavirtual users]# alias su -bash: alias: su: not found [root@icbavirtual users]# echo "'$PS1'" '[\u@\h \W]\$ ' [root@icbavirtual users]# echo "'$PROMPT_COMMAND'" 'echo -ne "\033]0;${USER}@${HOSTNAME%%.*}:${PWD/#$HOME/~}\007"' [root@icbavirtual users]# |
Quote:
Unfortunately I forgot that su could be a function as well an alias :doh: What is the output of Code:
type su |
Please note that PS1 and PROMPT_COMMAND should be checked for user oradb (not root), since the "switch user" command succeeded and maybe there is something weird after that.
|
Quote:
On re-reading the thread, the symptoms are uncertain. From the first post Code:
[root@virtual ~]# su - <username> Code:
[root@icbavirtual ~]# su - oradb Assuming the login shell is bash, this can be tested, as oradb, by running Code:
bash --login |
All times are GMT -5. The time now is 06:57 PM. |