I know how the problem was created, but really have no idea how to restore the server command execution.
The thing is, I was configuring the environment variables of Glassfish in my Ubuntu server, and I modified the .bashrc
file from root and added an export
clause (with GLASSFISH_HOME
variable) and a PATH
clause (pointing to the $GLASSFISH_HOME/bin
).
Right after I close the console and open it again so the changes take effect, and (BAM!) once I start the new console session then none of the basic commands (dir
, find
, nano
, ifconfig
, anything) work now, I can only use cd
to move in directories, I am trying to edit again the .bashrc
file to undo the changes but can't edit it either, none of the editors open! In the command line I only get -bash: dir: command not found
.
Please, if you have any solution for this; I know it seems trivial, but I'm kind of blind without being able to see or find the files and folders where commands/applications are located.
Do an export of the binary paths:
export PATH=$PATH:/bin:/usr/bin
right after that you're able again to operate and to reverse your changes.
Otherwise just do an edit with your favorite editor while given the full path to your editors binary:
/usr/bin/emacs -nw /root/.bashrc
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With