No such file or directory after typing $PATH in terminal

Solution 1:

$PATH is a variable, which I am sure you're aware of. When that variable is resolved, it would be the same as typing in :/home/bo/bin:/usr/local/bin:/usr/sbin:/usr/local/sbin:/usr/bin:/sbin:/bin: and expecting something to happen. The reason echo $PATH works is because you're explicitly piping it out to the display rather than telling the terminal to "do" $PATH.

Solution 2:

In case you still don't get it from the other answers, it's the same as this:

$ echo the quick brown fox
the quick brown fox
$ the quick brown fox
bash: the: command not found

$ echo and/or the black and white cats
and/or the black and white cats
$ and/or the black and white cats
bash: and/or: No such file or directory

The first word of every command line has to be a commandecho is such a command.  the, and/or, and :/home/bo/bin:/usr/local/bin:/usr/sbin… are not.  And, apparently, when you type a command line that begins with a word that isn't a command, bash says No such file or directory if the word contains one or more / characters, and command not found if it doesn't.