scslx 发表于 2004-3-16 15:44:18

求助,我的命令行始终为bash-2.05b#,看不到目录啊,

高手帮一下

syrick 发表于 2004-3-16 15:54:09

能详细一点吗?
什么状态下看不到目录?
ls ?

felix 发表于 2004-3-16 16:09:31

看一下你的/etc/bashrc
以下是我的:
# /etc/bashrc

# System wide functions and aliases
# Environment stuff goes in /etc/profile

# by default, we want this to get set.
# Even for non-interactive, non-login shells.
if [ "`id -gn`" = "`id -un`" -a `id -u` -gt 99 ]; then
      umask 002
else
      umask 022
fi

# are we an interactive shell?
if [ "$PS1" ]; then
    case $TERM in
      xterm*)
                if [ -e /etc/sysconfig/bash-prompt-xterm ]; then
                        PROMPT_COMMAND=/etc/sysconfig/bash-prompt-xterm
                else
                PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME%%.*}:${PWD/#$HOME/~}\007"'
               fi
                ;;
      screen)
                if [ -e /etc/sysconfig/bash-prompt-screen ]; then
                        PROMPT_COMMAND=/etc/sysconfig/bash-prompt-screen
                else
                PROMPT_COMMAND='echo -ne "\033_${USER}@${HOSTNAME%%.*}:${PWD/#$HOME/~}\033\\"'
                fi
                ;;
      *)
                [ -e /etc/sysconfig/bash-prompt-default ] && PROMPT_COMMAND=/etc/sysconfig/bash-prompt-default
            ;;
    esac
    # Turn on checkwinsize
    shopt -s checkwinsize
    [ "$PS1" = "\\s-\\v\\\$ " ] && PS1="[\u@\h \W]\\$ "
   
    if [ "x$SHLVL" != "x1" ]; then # We're not a login shell
      for i in /etc/profile.d/*.sh; do
            if [ -r "$i" ]; then
                . $i
            fi
      done
    fi
fi
# vim:ts=4:sw=4

如果正常,请在你的home里建立.bashrc
# .bashrc

# User specific aliases and functions

# Source global definitions
if [ -f /etc/bashrc ]; then
      . /etc/bashrc
fi

scslx 发表于 2004-3-16 21:05:46

这时我的,而且原来用于表示文件类型不同的颜色也没有了,我记得 我动过 察看方式的设置 后 九成这样了
# System wide functions and aliases
# Environment stuff goes in /etc/profile
                                                                              
# by default, we want this to get set.
# Even for non-interactive, non-login shells.
if [ "`id -gn`" = "`id -un`" -a `id -u` -gt 99 ]; then
    umask 002
else
    umask 022
fi
                                                                              
# are we an interactive shell?
if [ "$PS1" ]; then
    if [ -x /usr/bin/tput ]; then
      if [ "x`tput kbs`" != "x" ]; then # We can't do this with "dumb" terminal
      stty erase `tput kbs`
      elif [ -x /usr/bin/wc ]; then
      if [ "`tput kbs|wc -c `" -gt 0 ]; then # We can't do this with "dumb" terminal
          stty erase `tput kbs`
      fi
"bashrc" 56L, 1497C

scslx 发表于 2004-3-16 22:02:43

通过设置终端的配置文件现在颜色有了,但是命令行还是这样
-bash-2.05b# cd ..
-bash-2.05b# ls
bin   devhome    lib         miscopt   roottmpvar
bootetcinitrdlost+foundmnt   procsbinusr
-bash-2.05b# cd home
-bash-2.05b#

零二年的夏天 发表于 2004-3-16 22:22:57

设置一下您的 PS1 变量试试看。

cicc 发表于 2004-3-18 01:42:20

建立用户时候出的问题应该是
最简单的方法是重新建立一个用户
上次我也这样

scslx 发表于 2004-3-18 18:25:49

-bash-2.05b#[ "$PS1" = "\\s-\\v\\\$ " ] && PS1="[\u@\h \W]\\$ "
#

我现在能看到,但是重新打开终端时,还是-bash-2.05b#,怎么保存

isun 发表于 2004-3-18 18:30:10

设置PS1:
在/etc/.bash_profile中加入
export PS1="[\u@\h \W]\\$ "

redlqs 发表于 2004-3-20 10:38:04

cd /mnt/sysimage
就能看到你的原本目录了吧
页: [1]
查看完整版本: 求助,我的命令行始终为bash-2.05b#,看不到目录啊,