第一种方法: 打开用户根目录下的: vi ~/.bash_profile # .bash_profile # Get the aliases and functions if [ -f ~/.bashrc ]; then . ~/.bashrc fi # User specific environment and startup programs PATH=$PATH:$HOME/bin export PATH alias php=/usr/local/php/bin/php 修改后保存 然后执
1.登录root用户 2.增加root用户对文件sudoers的写权限 chmod u+w /etc/sudoers 3.编辑sudoers,把用户mysql添加进去 vi /etc/sudoers 找到如下行,并且在下面添加mysql的配置: root ALL=(ALL) ALL mysql ALL=(ALL) ALL 4.去掉root用户对文件sudoers的写权限 chmod u-w /etc/sudoers
所谓 Shell 内建命令,就是由 Bash 自身提供的命令,而不是文件系统中的某个可执行文件. 可以使用 type 来确定一个命令是否是内建命令: [root@localhost ~]# type cd cd is a Shell builtin [root@localhost ~]# type ifconfig ifconfig is /sbin/ifconfig 由此可见,cd 是一个 Shell 内建命令,而 ifconfig 是一个外部文件,它的位置是/sbin/ifconfig. 还