Command not found in ssh but is in direcory

103 Views Asked by At

I am using an ssh account that connects to an external server, i have downloaded through guix some software like samtools and bedtools but when i try to use them in my directory it gives me this error:

-bash: samtools: command not found

In my direcory, however, there is the directry guix.profile and if I go into the bin folder of this, I have everything I downloaded.

What am I doing wrong? Thank you

enter image description here

1

There are 1 best solutions below

4
On

To run a file from the shell you need two things:

  1. The shell must find the file

Being in the same directory does not enable the shell to find the file. You have to either supply an absolute or relative path the file, or have the directory in your PATH environment variable

In simplest terms this means instead of

$ samtools

try

$ ./samtools

The relative path tells the shell it wants that file

To run it from another directory, either use the whole absolute path, e.g. /home/yourname/samtools , or move the file into a directory that is on your $PATH

  1. The file needs to be executable

If the file is not executable you will need

$ chmod +x ./samtools