Topics

Command not found

chuck gelm
 

On 2/10/20 4:18 PM, @KK4JOW wrote:
This is what I get when I type in sudo ls -l

total 80
drwxr-xr-x  2 pi pi 4096 Oct 28 21:04 ardop
drwxr-xr-x  2 pi pi 4096 Feb  1 16:56 Desktop
drwxr-xr-x  5 pi pi 4096 Feb  6 11:48 Documents
drwxr-xr-x  3 pi pi 4096 Oct 27 20:50 Downloads
drwxr-xr-x  3 pi pi 4096 Feb 21  2019 dump1090_1.3.1_sdrplay
drwxr-xr-x  6 pi pi 4096 Oct 12 13:18 GridTracker
drwxr-xr-x 50 pi pi 4096 Oct 27 20:51 HamRadio
drwxr-xr-x  2 pi pi 4096 Jul  9  2019 MagPi
drwxr-xr-x  2 pi pi 4096 Oct 11 19:36 Music
drwxr-xr-x  5 pi pi 4096 Oct 27 20:50 perl5
drwxr-xr-x  2 pi pi 4096 Oct 27 21:47 Pictures
drwxr-xr-x  2 pi pi 4096 Oct 11 19:36 Public
drwxr-xr-x  6 pi pi 4096 Oct 14 16:17 pyqso-1.1.0
drwxr-xr-x  9 pi pi 4096 Feb  1 16:51 qsstv
drwxr-xr-x  2 pi pi 4096 Feb  6 11:48 Scratch
drwxr-xr-x  2 pi pi 4096 Oct 11 19:36 Templates
drwxr-xr-x  2 pi pi 4096 Oct 11 19:36 Videos
drwxr-xr-x  3 pi pi 4096 Oct 25 19:40 weather
drwxr-xr-x  3 pi pi 4096 Oct 25 17:43 wsjtx_to_n3fjp
drwxr-xr-x  7 pi pi 4096 Oct 18 13:31 YAAC
Jumping in here:

To clarify, please 'copy-n-paste' your console command(s) into this thread.
e.g.

gelmce@gelmce-net:~$ blah-blah
blah-blah: command not found
gelmce@gelmce-net:~$ pwd
/home/gelmce
gelmce@gelmce-net:~$ $PATH
bash: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games: No such file or directory
gelmce@gelmce-net:~$ ls -l
total 180
-rw-r--r-- 1 gelmce gelmce  2145 Jul 13  2019  0.txt
-rw-rw-r-- 1 gelmce gelmce  2145 Jul 13  2019  1.txt
-rw-rw-r-- 1 gelmce gelmce  2084 Jul 13  2019  2.txt
-rw-rw-r-- 1 gelmce gelmce 13106 Jun 19  2019  asterisk-rvvv.txt
-rw------- 1 gelmce gelmce 50870 Jan  6 11:26  DARA_Tech_PPT.tmp
-rw------- 1 gelmce gelmce 50872 Jan  6 11:27  DARA_Tech_PPT.tmp.1
drwxr-xr-x 2 gelmce gelmce  4096 Apr 16  2019  Desktop
drwxr-xr-x 2 gelmce gelmce  4096 Jun 10  2019  Documents
drwxr-xr-x 5 gelmce gelmce  4096 Jan 31 07:44  Downloads
drwxr-xr-x 2 gelmce gelmce  4096 Apr 16  2019  Music
-rw-r--r-- 1 gelmce gelmce  1193 Aug 13 07:47  OLF-2019.txt
drwxr-xr-x 2 gelmce gelmce  4096 Apr 16  2019  Pictures
drwxr-xr-x 2 gelmce gelmce  4096 Apr 16  2019  Public
drwxr-xr-x 2 gelmce gelmce  4096 Apr 16  2019  Templates
-rw-r--r-- 1 gelmce gelmce 11925 Aug 27 05:44 't kofc500.net ns1.bluehost.com'
drwxr-xr-x 2 gelmce gelmce  4096 Apr 16  2019  Videos
gelmce@gelmce-net:~$

Chuck

KK4JOW
 

This is what I get when I type in sudo ls -l

total 80
drwxr-xr-x  2 pi pi 4096 Oct 28 21:04 ardop
drwxr-xr-x  2 pi pi 4096 Feb  1 16:56 Desktop
drwxr-xr-x  5 pi pi 4096 Feb  6 11:48 Documents
drwxr-xr-x  3 pi pi 4096 Oct 27 20:50 Downloads
drwxr-xr-x  3 pi pi 4096 Feb 21  2019 dump1090_1.3.1_sdrplay
drwxr-xr-x  6 pi pi 4096 Oct 12 13:18 GridTracker
drwxr-xr-x 50 pi pi 4096 Oct 27 20:51 HamRadio
drwxr-xr-x  2 pi pi 4096 Jul  9  2019 MagPi
drwxr-xr-x  2 pi pi 4096 Oct 11 19:36 Music
drwxr-xr-x  5 pi pi 4096 Oct 27 20:50 perl5
drwxr-xr-x  2 pi pi 4096 Oct 27 21:47 Pictures
drwxr-xr-x  2 pi pi 4096 Oct 11 19:36 Public
drwxr-xr-x  6 pi pi 4096 Oct 14 16:17 pyqso-1.1.0
drwxr-xr-x  9 pi pi 4096 Feb  1 16:51 qsstv
drwxr-xr-x  2 pi pi 4096 Feb  6 11:48 Scratch
drwxr-xr-x  2 pi pi 4096 Oct 11 19:36 Templates
drwxr-xr-x  2 pi pi 4096 Oct 11 19:36 Videos
drwxr-xr-x  3 pi pi 4096 Oct 25 19:40 weather
drwxr-xr-x  3 pi pi 4096 Oct 25 17:43 wsjtx_to_n3fjp
drwxr-xr-x  7 pi pi 4096 Oct 18 13:31 YAAC
 

KK4JOW
 

This is what comes back when I type env

SHELL=/bin/bash
COLORTERM=truecolor
XDG_CONFIG_DIRS=/etc/xdg
XDG_SESSION_PATH=/org/freedesktop/DisplayManager/Session0
XDG_MENU_PREFIX=lxde-pi-
LANGUAGE=en_US.UTF-8
_LXSESSION_PID=1049
SSH_AUTH_SOCK=/tmp/ssh-dUo9RIW1pJAN/agent.1049
XDG_CONFIG_HOME=/home/pi/.config
DESKTOP_SESSION=LXDE-pi
SSH_AGENT_PID=1091
QRZ_PASSWORD=smokie96
NO_AT_BRIDGE=1
XDG_SEAT=seat0
PWD=/home/pi
XDG_SESSION_DESKTOP=lightdm-xsession
LOGNAME=pi
QT_QPA_PLATFORMTHEME=cleanlooks
XDG_SESSION_TYPE=x11
GPG_AGENT_INFO=/run/user/1000/gnupg/S.gpg-agent:0:1
CXXFLAGS=-O2 -march=native -mtune=native
XAUTHORITY=/home/pi/.Xauthority
XDG_GREETER_DATA_DIR=/var/lib/lightdm/data/pi
HOME=/home/pi
LANG=en_US.UTF-8
LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:
XDG_CURRENT_DESKTOP=LXDE
VTE_VERSION=5402
XDG_SEAT_PATH=/org/freedesktop/DisplayManager/Seat0
PERL5LIB=/home/pi/perl5/lib/perl5
MAKEFLAGS=-j 4
XDG_SESSION_CLASS=user
PYTHONPATH=:/usr/local/lib/python3.7/site-packages:/usr/local/lib/python3.7/site-packages/.libs
TERM=xterm-256color
PERL_MB_OPT=--install_base "/home/pi/perl5"
USER=pi
PERL_MM_OPT=INSTALL_BASE=/home/pi/perl5
DISPLAY=:0
SHLVL=1
XDG_VTNR=7
XDG_SESSION_ID=c1
LD_LIBRARY_PATH=/opt/install/libsdrplay/lib:
XDG_RUNTIME_DIR=/run/user/1000
LC_ALL=en_US.UTF-8
QRZ_USERNAME=W3DJS
XDG_DATA_DIRS=/usr/share/fkms:/usr/local/share:/usr/share/raspi-ui-overrides:/usr/share:/usr/share/gdm:/var/lib/menu-xdg
PERL_LOCAL_LIB_ROOT=/home/pi/perl5
PATH=/home/pi/perl5/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games
GDMSESSION=lightdm-xsession
CFLAGS=-O2 -march=native -mtune=native
SAL_USE_VCLPLUGIN=gtk3
DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus
TEXTDOMAIN=Linux-PAM
_=/usr/bin/env


That QRZ password is nothing I ever entered. 

KK4JOW
 

when I type in echo $PATH it comes back with:

/home/pi/perl5/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games

When I enter /bin/ls it comes back with

ardop    dump1090_1.3.1_sdrplay  Music     pyqso-1.1.0  Videos
Desktop    GridTracker    perl5     qsstv   weather
Documents  HamRadio    Pictures  Scratch   wsjtx_to_n3fjp
Downloads  MagPi    Public    Templates   YAAC





 

Jim Hudson
 

Disregard previous.

I see you screen shot.

Post you APPLICATION lines.

73,
Jim

Jim Hudson
 

What commands don't work?

Does 'env<ENTER>' without quotes put anything on the screen.

Could be a permission problem. Try sudo ls -l
Does that give you the contents of the directory your in?

You might try to restore your profile:
sudo cp /etc/profile /home/pi/.profile
((Note the period)
Reboot

73,
Jim

Eric
 

Since you can log in, all is not lost and you should not have to reimage the pi to get things working.



If you type in a program name (like ls) at the prompt and there is no explicitly specified path, the shell searches, in order, each directory listed in the PATH environment variable for the program. The first instance of the program that is found gets executed. Only after searching "everywhere" without finding the program, will you get the "command not found" error.

The other effect of the above is that if you have two copies of one program and you update only one you might not see the results of an update.


If there is no PATH environment variable defined, there is no place to search, so you would have to explicitly (as done below with the ls command) specify the correct path to get it to work.



Anyway....


What is the result of the command

echo $PATH

followed, of course, by enter ?



The echo command is a built-in command for the bash shell and should work as it's not an external to bash.



Since you have a Raspberry Pi, see if typing

/bin/ls

works.

If the result of the echo $PATH shows no text and /bin/ls works, then your login session has lost its path.

If this is the case, the next step is to figure out what happened to the path. Please let me know what happens.





Eric, WB6TIX

KK4JOW
 

I don't know what directory I am in or how it changed. All these commands worked before.

Jerome Kutche
 

Are u in correct directory to run these commands? Just a thought 73 Jerry

 

From: RaspberryPi-4-HamRadio@groups.io <RaspberryPi-4-HamRadio@groups.io> On Behalf Of KK4JOW@...
Sent: Sunday, February 9, 2020 1:53 PM
To: RaspberryPi-4-HamRadio@groups.io
Subject: [RaspberryPi-4-HamRadio] Command not found

 

I don't know what I've done but my pi doesn't seem to recognize any commands. They all come aback with " bash: command not found"

How can I fix this? I've run update and upgrade and rebooted.

Thanks

Eric
 

My guess is that your PATH environment variable was removed.

If you type echo $PATH (echo is built into the shell), you should get something like
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:


When you type in a command, BASH looks to see if the command is built in. If not, it then looks though the various paths until it finds the command.

I'm having to "bail out" right now to go meet some folks, but check out the following.

https://unix.stackexchange.com/questions/227989/complete-view-of-where-the-path-variable-is-set-in-bash

(be care of the possible line breaks)

and in your home directory is a file called .profile Note it has the "dot" in front of the file name. The dot keeps the file from being displayed unless you want by adding the -a option to ls.


The commands are likely there, but just not accessible because the path. So, while you are looking around, try

PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:

and then

so you can at least look around.

Eric

kev.scott@...
 

Re-image?

KK4JOW
 

I don't know what I've done but my pi doesn't seem to recognize any commands. They all come aback with " bash: command not found"
How can I fix this? I've run update and upgrade and rebooted.
Thanks