alias
In which file the aliases are defined for the shell?
cause where I run alias i can see that there are many alias by default defined but in which file they are defined I don't know that. can any body tell me that in which file these aliases are defined in slackware 10.0 cause I have to remove an alias from that file. |
in your .bashrc
(home/usrname/.bashrc) |
Do you mean aliases for email addresses that are used as short cuts for addressing emails? Or, do you mean aliases that are shorthand versions of longer commands?
The first type are often stored in an .alias or .aliases file in your home directory (could also be without the leading dot - alias or aliases). It depends somewhat on what you are using as an email client and how the client is configured. Assuming you are using the bash shell, aliases that are command shortcuts are often found in the .bashrc, .bash_profile or .profile files in your home directory. Look for something like "alias name=command". |
no i don't mean alias for email address I mean alias for the bash shell.
"busbarn" i don't have any (home/usrname/.bashrc) directory i am on slackware 10.0 |
"usrname" isn't literal. he means you need to put the username in place of "usrname". also the file is hidden. it is more than likely there already.
|
ilnli, in your home directory, do a `ls -a` and you will see one of .bashrc, .bash_profile or .profile. If you don't have any of these, then the alias you are looking for may be in /etc/profile. To change that file, you will probably have to be root.
|
[CODE]
root@DARKSTAR:/etc# alias alias d='dir' alias dir='/usr/bin/ls $LS_OPTIONS --format=vertical' alias ls='/usr/bin/ls $LS_OPTIONS' alias mc='. /usr/share/mc/bin/mc-wrapper.sh' alias v='vdir' alias vdir='/usr/bin/ls $LS_OPTIONS --format=long' root@DARKSTAR:/etc# root@DARKSTAR:~# ls -a ./ .gstreamer-0.8/ .xine/ ls ../ .gtkrc-1.2-gnome2 .xinitrc ls.log .DCOPserver_DARKSTAR_:0@ .kde/ .xinitrc-backup minicom.log .DCOPserver_DARKSTAR__0 .kderc .xmms/ mouse.html .ICEauthority .links/ CORE_IMPACT_3.3.rar network.html .Xauthority .local/ Desktop/ out .bash_history .mcop/ SuSE.Linux.9.1.professional.CD1of5.by.Kiffer.iso out.log .config/ .mcoprc a.out* packages.html .fonts.cache-1 .mozilla/ booting.html pakaims.edu .fonts.conf .netwatch.1.0a drivers/ ppp.html .fullcircle/ .qt/ gaim-1.1.1.tar.gz.part raptor_chown.c* .gaim/ .recently-used hsfmodem-7.18.00full/ rootdir.html .gconf/ .sane/ hsfmodem-7.18.00full-1.i386.rpm.zip slack\ startup.html .gconfd/ .ssh/ hsfmodem-7.18.00full.tar.gz* stats/ .gkrellm2/ .thumbnails/ hsfmodem-doc-7.18.00full-1.noarch.rpm.zip telnet .gnome/ .toprc init.html users.html .gnome2/ .viminfo loadlin16c.txt x.html .gnome2_private/ .vimrc loadlin16c.zip root@DARKSTAR:~# root@DARKSTAR:/etc# ls -a ./ genpowerd.conf isapnp.gone.sample my-medium.cnf scrollkeeper.conf ../ gimp/ issue my-small.cnf securetty .pwd.lock gnome-vfs-2.0/ issue.net nail.rc security/ DIR_COLORS gnome-vfs-mime-magic joe/ named. |
Code:
|
any other?
|
You can try the bash built-in "unalias."
Quoting from the bash manpages published online at this URL http://www.die.net/doc/linux/man/man1/bash.1.html: alias [-p] [name[=value] ...] Alias with no arguments or with the -p option prints the list of aliases in the form alias name=value on standard output. When arguments are supplied, an alias is defined for each name whose value is given. A trailing space in value causes the next word to be checked for alias substitution when the alias is expanded. For each name in the argument list for which no value is supplied, the name and value of the alias is printed. Alias returns true unless a name is given for which no alias has been defined. unalias [-a] [name ...] Remove each name from the list of defined aliases. If -a is supplied, all alias definitions are removed. The return value is true unless a supplied name is not a defined alias. |
One other question. Is the alias only active when you are root, or is it also active when you are logged in under your normal non-root account?
|
aliase are only active if the user source a file with aliases (~/.bashrc, ~/.zshrc, /etc/profile...). If your user-account has such file you can use aliases as well.
|
ilnli, the various 'ls' aliases you're seeing are set by the
Code:
eval `dircolors -b` Code:
for profile_script in /etc/profile.d/*.sh ; do |
Wow, I remember those aliases from a long time ago. I think I kept one of them... BUT, I forget where I erased them from. I inserted a "source ~/.alias" line into my /etc/profile line and it loads the whole profile list *I* built.
SOP loads your system from both the /etc/ directory and your /home/xxx directory. I suggest doing a "grep vdir *" and "grep vdir .*" in both directories. "vdir" is pretty unique and should pop up a file name that is keeping it. --vonSt |
All times are GMT -5. The time now is 07:34 AM. |