修复树莓派PATH变量
使用lnmp一键工具安装完nmp后,重启进入系统就提示bash command not found 然后试了试service,who等命令也无法使用 只有最基本的系统命令ls,cat等可以用 看来安装lnmp后,我的PATH变量被动了 先临时修改下PATH,便于后面操作 export PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:$PATH 然后检查~/.profile,/etc/profile是否存在,存在 检查其中的PATH赋值是否异常 经过排查,发现/etc/profile中的PATH赋值异常,修改之重启OK! 在此分享正确的原始~/.profile和/etc/profile文件 ~/.profile 内容 # ~/.profile: executed by the command interpreter for login shells. # This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login # exists. # see /usr/share/doc/bash/examples/startup-files for examples. # the files are located in the bash-doc package. # the default umask is set in /etc/profile; for setting the umask # for ssh logins, install and configure the libpam-umask package. #umask 022 # if running bash if [ -n "$BASH_VERSION" ]; then # include .bashrc if it exists if [ -f "$HOME/.bashrc" ]; then . "$HOME/.bashrc" fi fi # set PATH so it includes user's private bin if it exists if [ -d "$HOME/bin" ] ; then PATH="$HOME/bin:$PATH" fi **/etc/profile内容 ** ...