[SOLVED] how to unalias "vi" and "ls" globally in Linux
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
Yes, I tried first "grep "alias" ~/.* -i" and saw nothing relevant.
Then I tried "grep "alias" /etc -ir", and this pointed to some files in /etc/profile.d
It seems some files in this directory are setting the aliases that I'm annoyed with.
colorls.csh:alias ll 'ls -l'
colorls.csh:alias l. 'ls -d .*'
colorls.csh:alias ll 'ls -l --color=tty'
colorls.csh:alias l. 'ls -d .* --color=tty'
colorls.csh:alias ls 'ls --color=tty'
colorls.sh:alias ll='ls -l' 2>/dev/null
colorls.sh:alias l.='ls -d .*' 2>/dev/null
colorls.sh: alias ll='ls -l --color=tty' 2>/dev/null
colorls.sh: alias l.='ls -d .* --color=tty' 2>/dev/null
colorls.sh: alias ls='ls --color=tty' 2>/dev/null
vim.csh: alias vi vim
vim.sh: # for bash and zsh, only if no alias is already set
vim.sh: alias vi >/dev/null 2>&1 || alias vi=vim
which-2.sh:alias which='alias | /usr/bin/which --tty-only --read-alias --show-dot --show-tilde'
But, logging in directly as root, and the typing "alias", I do not see some of these aliases.
For example, the alias for vi to point to vim instead.
alias cp='cp -i'
alias l.='ls -d .* --color=tty'
alias ll='ls -l --color=tty'
alias ls='ls --color=tty'
alias mv='mv -i'
alias rm='rm -i'
alias which='alias | /usr/bin/which --tty-only --read-alias --show-dot --show-tilde'
Sometimes it helps to trace what happens (there can be a lot of output, especially when using bash --login instead of just bash to trace what happens when a login shell starts up):
Some scrippets in /etc/profile.d have comments to identify themselves when they are run. Helpful
/etc/profile.d/*.sh files can be disabled by changing their extensions, by emptying them or by removing read permission from them. The first method will not survive an upgrade, the second two probably will, depending on what the upgrade does when it finds package files have been modified.