Erek Dyskant erek@blumenthals.com wrote:
This was discussed previously soon after CentOS 5.0 was released. The
upstream distribution changed root from using vim (with syntax highlighting) to using vi. With the 4.X versions root was using vim. The 5.X configuration is:
[root@bend ~]# which vi /bin/vi
[dave@bend ~]# which vi vi: aliased to vim [dave@bend ~]# which vim /usr/bin/vim
In theory, programs in /bin are statically linked, so they work even when you have library issues going on. Anyway, just use the vim command explicitly or add alias vi=vim to your ~root/.profile
The static linking part is no longer true:
[root@bend ~]# ls -l /bin/vi -rwxr-xr-x 1 root root 628808 May 9 2007 /bin/vi [root@bend ~]# file /bin/vi /bin/vi: ELF 64-bit LSB executable, AMD x86-64, version 1 (SYSV), for GNU/Linux 2.6.9, dynamically linked (uses shared libs), for GNU/Linux 2.6.9, stripped
I would guess that any shared libraries used by vi are in or under /lib. That way the required libraries should also always be available.
Just for comparison, the executable for vim is quite a bit bigger:
[root@bend ~]# ls -l /usr/bin/vim -rwxr-xr-x 1 root root 2817056 May 9 2007 /usr/bin/vim
This is just another example of the upstream distribution being very conservative for possibly several different reasons. There are also a number of ways to override their choice. I just wanted to point out that the change from vim to vi for root was intentional. Someone changing it back should understand the implications of what they're doing.
Cheers, Dave