1

I was trying to add a new path to my bashrc file but I have seemed to messed something up. after I $ source ~/.bashrc I no longer can use the commands ls, mv, cp, cat, vi, and probably others that I haven't tried yet. Is there anyway I can reset the path so it all comes back?

[rn1041@cluster ~]$ ls
-bash: ls: No such file or directory
[rn1041@cluster ~]$ rm
-bash: rm: No such file or directory
[rn1041@cluster ~]$ cp
-bash: cp: No such file or directory
[rn1041@cluster ~]$ mv
-bash: mv: No such file or directory
[rn1041@cluster ~]$ echo path
path
Richard
  • 13

2 Answers2

3

Most commonly used commands (including the ones you tried) are in /bin, so you can run them by typing /bin/ls, etc.

P.S. What you meant to do is echo "$PATH".

2

Here is an original, untouched ~/.bashrc from CentOS 6.

# .bashrc

# User specific aliases and functions

alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'

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

You probably meant to do something like this:

export PATH=$PATH:your/path/here
canon
  • 79