# Commands not found.



## lin (Jul 15, 2011)

First of all I want to say sorry for not where to ask this question.

The commands do not work on my FreeBSD, ie for example: `pkg_add-r fluxbox`
He says the console:

```
pkg_add: command not found
```


```
pw show Greep wheel:
  command not found: pw
```

And so with many other commands you need. :\


----------



## UNIXgod (Jul 15, 2011)

Some commands to help you debug:

`# which pkg_add`
`% echo $PATH`

most likely your path needs to be set correctly. Also you need to be root to use that command.

look at /etc/group to see if your in wheel.


----------



## lin (Jul 15, 2011)

```
# which pkg_add
pkg_add not found
```


```
# echo $PATH
/usr/local/lib/cw:/bin:/usr/bin:/usr/local/bin
```


I get that but not if it's okay.


----------



## graudeejs (Jul 15, 2011)

By default *$PATH* is set to

```
/sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/sbin:/usr/local/bin:/home/[B]username[/B]/bin
```


----------



## lin (Jul 15, 2011)

killasmurf86 said:
			
		

> By default *$PATH* is set to
> 
> ```
> /sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/sbin:/usr/local/bin:/home/[B]username[/B]/bin
> ```



If it works. I use zsh and me .zshrc I have:

```
export PATH="/usr/local/lib/cw:$PATH"
```

I use it for cw (color wrapper) to color the output of the commands.
Also add the path by default:

```
export PATH="/sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/sbin:/usr/local/bin:/home/lin/bin:$PATH"
```
Wrapper Color but no longer works.


----------



## lin (Jul 15, 2011)

EDIT:
Change the order of the path and it works pkg_add and other commands.

Solved


----------



## UNIXgod (Jul 15, 2011)

I'm a dumbass I actually didn't realize that which()(1) depended on $PATH.

lin you could use $HOME/.bin (or without the dot) instead of home/lin/bin
It will be more portable if you ever reuse it under a different user.

btw zsh is a great shell. I use it myself.


----------



## lin (Jul 16, 2011)

Thanks for replying, the problem was solved


----------

