Sunday, May 5, 2024
77
rated 0 times [  77] [ 0]  / answers: 1 / hits: 746785  / 2 Years ago, sat, january 15, 2022, 10:26:00

I was updating my .bash_profile, and unfortunetly I made a few updates and now I am getting:



env: bash: No such file or directory
env: bash: No such file or directory
env: bash: No such file or directory
env: bash: No such file or directory
env: bash: No such file or directory
-bash: tar: command not found
-bash: grep: command not found
-bash: cat: command not found
-bash: find: command not found
-bash: dirname: command not found
-bash: /preexec.sh.lib: No such file or directory
-bash: preexec_install: command not found
-bash: sed: command not found
-bash: git: command not found


My bash_profile actually pulls in other .sh files (sources them) so I am not exactly sure which modification may have caused this.



Now if I even try and to a list of files, I get:



>ls
-bash: ls: command not found
-bash: sed: command not found
-bash: git: command not found


Any tips on how to trace the source of the error, and how to be able to use the terminal for basic things like listing files etc?


More From » command-line

 Answers
7

It looks to me that at one point or another you are overwriting the default PATH environment variable. The type of errors you have, indicates that PATH does not contain /bin, where the above commands (including bash) reside.



For example, if you do



PATH=/home/user/bin


instead of



PATH="$PATH":/home/user/bin

[#35608] Sunday, January 16, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
ranquctive

Total Points: 391
Total Questions: 103
Total Answers: 104

Location: South Sudan
Member since Thu, Feb 4, 2021
3 Years ago
ranquctive questions
;