TAB doesn't show available commands

Posted on 2006-04-03
Last Modified: 2013-12-06
When I log into this HP UNIX machine with the root account, everything works fine, but then i switch user to my own user account it doesn't work.

When I am root, the promt looks like this
[root@testserver] /systems >

When i use my own account, the promt looks like this

Anyone know how to fix this? so i can TAB my way through commands on my own account??
Question by:dreamer81
    LVL 38

    Accepted Solution

    your defaul login shell is sh, if you want to change your default login shell, modify /etc/passwd file, or run "sam" to change the login shell.

    How the promt looks like, it depends on the setting of PS1 in your login script.
    LVL 1

    Expert Comment

    From the shell prompt it looks like the root has the default shell as 'bash'. If you want to make bash your default shell, use the method that yuzh suggests.

    If you want to make changes to the /etc/passwd file, you should know the path of the bash shell command. You can do a 'which bash' or 'whereis bash' to get the path of bash. It will mostly be /usr/bin/bash or /usr/local/bin/bash.

    To change the prompt, refer
    For e.g. The "[root@testserver] /systems >" prompt can be created by doing the following
    PS1="[\u@\h] \w>"
    LVL 61

    Expert Comment

    only bash completes commands and filenames

    use chsh to chenge your shell
    /etc/shells hints you with valid shells.

    LVL 3

    Assisted Solution

    Hi dreamer81,

    I am going to give an answer to your questions and some explanation to you:

    1. To use TAB, you are going to need the shell called "bash", it usually comes with Linux and not with HP-UX, so if you don't have it in your HP-UX, you can download it from
    If you don't have how to "install" bash, there is a command you can use, it is similar to TAB, but it will be used for files in the current directory and commands you have already executed.
    In the shell, type "set -o vi" and your shell will be similar to bash: you can start to write a filename that is in the current directory, press: "ESC + ESC", and it will finish to write the filename, also you can use it to check the commands you have already executed: press -> "Ctrl + k" -> Backward - "Ctrl + j" -> Forward. Be careful, k and j are lowercase.

    2. About the prompt you want to change, you have to change and export the environment variable called: PS1
    Try: echo ${PS1}

    You can do a lot of things with this variable, I am going to show you some of them:
    export PS1="[`/usr/bin/whoami`@`/usr/bin/uname -n`]:\$PWD# "

    In the above, you will have something similar to:
    [<Current User>@<Hostname>]:<Current Path>#

    The good thing above is the <Current Path>, because it will always show the current directory with path to it.
    [utest@Test]:/opt/java1.4# pwd
    [utest@Test]:/opt/java1.4# cd ..
    [utest@Test]:/opt# pwd

    You can put the export in your profile:
    cd $HOME
    vi .profile

    Just for further information, if you check in all unix environments, you will always have 4 PS variables: PS1, PS2, PS3, PS4
    [utest@Test]:/opt# set | grep PS
    If you want to know what they are used for, check the link:

    I hope it helps. =0)
    LVL 3

    Expert Comment

    Ops... I made a mistake above: when I say "press -> "Ctrl + k" -> Backward - "Ctrl + j" -> Forward", change the "Ctrl" to "ESC".

    How I could do that? hahah

    LVL 51

    Expert Comment

    root_start, did you miss to tell us that your "set -o vi" is for ksh?

    >  only bash completes commands and filenames
    tcsh can do it also
    csh completes directories and filenames too, but not commands
    LVL 61

    Expert Comment

    No comment has been added to this question in more than 21 days, so it is now classified as abandoned.
    I will leave the following recommendation for this question in the Cleanup topic area:

    split between yuzh http:#16368394 and root_start http:#16651153

    Any objections should be posted here in the next 4 days. After that time, the question will be closed.

    EE Cleanup Volunteer

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    When you do backups in the Solaris Operating System, the file system must be inactive. Otherwise, the output may be inconsistent. A file system is inactive when it's unmounted or it's write-locked by the operating system. Although the fssnap utility…
    In tuning file systems on the Solaris Operating System, changing some parameters of a file system usually destroys the data on it. For instance, changing the cache segment block size in the volume of a T3 requires that you delete the existing volu…
    Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
    Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…

    745 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now