红联Linux门户
Linux帮助

求助:bash:(文件名)不能找到文件或目录

发布时间:2011-10-22 11:25:08来源:红联作者:sull
最近安装了一个软件,在ubunt11.10系统中。一个压缩包,解压缩后放到opt文件夹中。权限已经设置好了。但是在终端中运行软件中的命令时,结果如下:
bash:(文件名)没有那个文件或目录
我在用户文件夹下的.bashrc文件中添加了,软件的环境变量。export 。。。。。。。
在软件的目录下运行ls,明明可以看到文件就在其目录下,可是就显示(bash:(文件名)没有那个文件或目录)。不知道怎么解决,
像各位高手请教。
谢谢
文章评论

共有 6 条评论

  1. sull 于 2011-10-24 14:05:32发表:

    现在有两个疑问,
    一是:我一个同学,他就是这样加的环境变量,但是可以运行。
    二是:怎么样添加PATH变量呀?

  2. gogo11 于 2011-10-23 22:10:58发表:

    你加的不对,系统找可执行文件是找PATH变量,他又不认识变量GRIDPRO~~~~~~~~~~~

  3. sull 于 2011-10-23 20:08:46发表:

    ls显示,是把文件夹中的文件全部显示出来了。

  4. sull 于 2011-10-23 20:08:06发表:

    因为运行linux时不能上网,一些命令我只能这样描述了。
    以下是在终端运行的。
    在这个文件夹下/opt/GP/bin/,运行其中的命令./az
    显示结果是:bash:az没有那个文件或目录。

  5. sull 于 2011-10-23 20:05:29发表:

    # ~/.bashrc: executed by bash(1) for non-login shells.
    # see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
    # for examples

    # If not running interactively, don't do anything
    [ -z "$PS1" ] && return

    # don't put duplicate lines in the history. See bash(1) for more options
    # ... or force ignoredups and ignorespace
    HISTCONTROL=ignoredups:ignorespace

    # append to the history file, don't overwrite it
    shopt -s histappend

    # for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
    HISTSIZE=1000
    HISTFILESIZE=2000

    # check the window size after each command and, if necessary,
    # update the values of LINES and COLUMNS.
    shopt -s checkwinsize

    # make less more friendly for non-text input files, see lesspipe(1)
    [ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)"

    # set variable identifying the chroot you work in (used in the prompt below)
    if [ -z "$debian_chroot" ] && [ -r /etc/debian_chroot ]; then
    debian_chroot=$(cat /etc/debian_chroot)
    fi

    # set a fancy prompt (non-color, unless we know we "want" color)
    case "$TERM" in
    xterm-color) color_prompt=yes;;
    esac

    # uncomment for a colored prompt, if the terminal has the capability; turned
    # off by default to not distract the user: the focus in a terminal window
    # should be on the output of commands, not on the prompt
    #force_color_prompt=yes

    if [ -n "$force_color_prompt" ]; then
    if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then
    # We have color support; assume it's compliant with Ecma-48
    # (ISO/IEC-6429). (Lack of such support is extremely rare, and such
    # a case would tend to support setf rather than setaf.)
    color_prompt=yes
    else
    color_prompt=
    fi
    fi

    if [ "$color_prompt" = yes ]; then
    PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
    else
    PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ '
    fi
    unset color_prompt force_color_prompt

    # If this is an xterm set the title to user@host:dir
    case "$TERM" in
    xterm*|rxvt*)
    PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1"
    ;;
    *)
    ;;
    esac

    # enable color support of ls and also add handy aliases
    if [ -x /usr/bin/dircolors ]; then
    test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
    alias ls='ls --color=auto'
    #alias dir='dir --color=auto'
    #alias vdir='vdir --color=auto'

    alias grep='grep --color=auto'
    alias fgrep='fgrep --color=auto'
    alias egrep='egrep --color=auto'
    fi

    # some more ls aliases
    alias ll='ls -alF'
    alias la='ls -A'
    alias l='ls -CF'

    # Add an "alert" alias for long running commands. Use like so:
    # sleep 10; alert
    alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'

    # Alias definitions.
    # You may want to put all your additions into a separate file like
    # ~/.bash_aliases, instead of adding them here directly.
    # See /usr/share/doc/bash-doc/examples in the bash-doc package.

    if [ -f ~/.bash_aliases ]; then
    . ~/.bash_aliases
    fi
    export GRIDPRO=/opt/GridPro
    # enable programmable completion features (you don't need to enable
    # this, if it's already enabled in /etc/bash.bashrc and /etc/profile
    # sources /etc/bash.bashrc).
    if [ -f /etc/bash_completion ] && ! shopt -oq posix; then
    . /etc/bash_completion
    fi
    这是.bashrc文件的内容,其中export GRIDPRO=/opt/GridPro这行是我加的

  6. 相思爱文 于 2011-10-22 17:54:18发表:

    列出数据,而不是要解释。
    在终端中运行软件中的命令时,
    把命令和屏幕显示内容原文列出来。
    把ls显示结果原文列出来。
    把.bashrc原文列出来。
    把方法详细说明,不需要解释,只说具体怎么做的和显示什么就可以。