I thought, if you call a command in bash, all of the directories set in $PATH would be searched for this command.
(running as root)
$ clamscan ./
-bash: /usr/bin/clamscan: No such file or directory
There is no clamscan in /usr/bin/, but in /usr/local/bin/ (and works if i call it from there):
$ ls -hail /usr/local/bin/
62259565 drwxr-xr-x 2 root root 4.0K Jul 21 14:19 .
62259561 drwxr-xr-x 11 root root 4.0K Apr 11 19:55 ..
62260816 -rwxr-xr-x 1 root root 1.1K Jul 21 14:19 clamav-config
62260819 -rwxr-xr-x 1 root root 75K Jul 21 14:19 clambc
62260817 -rwxr-xr-x 1 root root 79K Jul 21 14:19 clamconf
62260821 -rwxr-xr-x 1 root root 141K Jul 21 14:19 clamdscan
62260823 -rwxr-xr-x 1 root root 137K Jul 21 14:19 clamdtop
62260822 -rwxr-xr-x 1 root root 95K Jul 21 14:19 clamscan
62260818 -rwxr-xr-x 1 root root 148K Jul 21 14:19 freshclam
I never changed $PATH. The directory /usr/local/bin/ is stated.
$ echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
It could work if I copy the files from /usr/local/bin/ to /usr/bin/, but I wonder why bash seems to only ask this single directory.
sudo
to elevate a single command to root; thus, open a terminal as yourself (not as root) and runsudo clamscan
. – Paddy Landau Jul 21 '12 at 18:42