Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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
Last edited by GrapefruiTgirl; 03-18-2010 at 02:15 AM.
[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]#
[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]#
Thanks for the information. I don't see any problem there.
Unfortunately I forgot that su could be a function as well an alias What is the output of
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.
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.
Thanks for spotting that colucix
On re-reading the thread, the symptoms are uncertain. From the first post
Code:
[root@virtual ~]# su - <username>
-bash: [<username>: command not found
[root@virtual ~]#
but later
Code:
[root@icbavirtual ~]# su - oradb
-bash: [oradb: command not found
[oradb@icbavirtual ~]$
Guessing the first was entered manually and the last line is wrong, then the "su -" command does succeed in switching user and the error message most likely comes from oradb's shell initialisation files.
Assuming the login shell is bash, this can be tested, as oradb, by running
Code:
bash --login
bash --login --noprofile
If the first generates the error message but the second doesn't then the problem is in one of ~/.bash_profile, ~/.bash_login or ~/.profile.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.