Linux – Can’t run sox, No such file or directory

linuxsoxUbuntuubuntu 12.04

In Ubuntu 12.04 I installed sox with this command:

sudo apt-get install sox

Now if I use this command:

sox message.wav message.flac rate 16k

I get this:

bash: /usr/local/bin/sox: No such file or directory

If I use this command:

sox --version

I get this:

bash: /usr/local/bin/sox: No such file or directory

But if I use this command:

which sox

I get this:

/usr/bin/sox

So now what do I have to do in order to convert WAV to FLAC using sox?

Best Answer

It looks like your shell has cached the location of sox for some reason. You can work around the problem by giving the full path of the command:

/usr/bin/sox message.wav message.flac rate 16k

Try hash -r to clear your shell's command cache. Also try alias | grep sox in case you have an alias set to a bad location.

Related Question