Alias problem
Forum rules
Topics in this forum are automatically closed 6 months after creation.
Topics in this forum are automatically closed 6 months after creation.
Alias problem
Hi,
I using Linux Mint 17 that is upgraded from Linux Mint 16.
I tried to set aliases as usual, but it goes very wrong
This is ".bash_profile" in my home directory
=======
alias install='sudo apt-get install'
=======
It is just a single line, very simple.
But if I typed "alias" to check aliases, it goes totally wrong.
=======
sehoonha@constantinople ~ $ alias
alias grep='grep --colour=auto'
'lias install='sudo apt-get install
alias ll='ls -al'
alias ls='ls --color=auto'
=======
See? How can possibly an entry starts with 'lias?
Of course, if I type install....
=======
sehoonha@constantinople ~ $ install
[sudo] password for sehoonha:
E: Invalid operation install
=======
If someone could help me to resolve this problem, I will really appreciate...
I using Linux Mint 17 that is upgraded from Linux Mint 16.
I tried to set aliases as usual, but it goes very wrong
This is ".bash_profile" in my home directory
=======
alias install='sudo apt-get install'
=======
It is just a single line, very simple.
But if I typed "alias" to check aliases, it goes totally wrong.
=======
sehoonha@constantinople ~ $ alias
alias grep='grep --colour=auto'
'lias install='sudo apt-get install
alias ll='ls -al'
alias ls='ls --color=auto'
=======
See? How can possibly an entry starts with 'lias?
Of course, if I type install....
=======
sehoonha@constantinople ~ $ install
[sudo] password for sehoonha:
E: Invalid operation install
=======
If someone could help me to resolve this problem, I will really appreciate...
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Re: Alias problem
Code: Select all
alias install='sudo apt-get install'
Code: Select all
source .bash_profile
enter sudo password and ta da!
you can always check your aliases with
Code: Select all
alias <alias_name>
Code: Select all
type <alias_name>
Re: Alias problem
Thanks for your kind response.
But the problem is that aliases are messed up only when it is *automatically* loaded from .bashrc.
But the problem is that aliases are messed up only when it is *automatically* loaded from .bashrc.
Re: Alias problem
Show us your .bashrc then.sehoonha wrote:Thanks for your kind response.
But the problem is that aliases are messed up only when it is *automatically* loaded from .bashrc.
I usually create aliases directly in .bashrc or use
Code: Select all
source /path/to/another/alias/file
Remove any alias causing issue from .bash_profile
and move it somewhere else, either in .bashrc or a new file and source it in .bashrc
I use .aliases (one of many such files) like so:
Code: Select all
grep aliases .bashrc | grep source
source /home/jj/.aliases
Code: Select all
alias stampl="date '+%a %b %d, %Y - %l:%M:%S %p %Z'" # original date/time stamp
alias stamp="date '+%a %b %d, %Y'"
alias ipcalc='ipcalc -b'
alias cal='cal -3'
alias ip="curl icanhazip.com"
alias heat="sensors -f"
in your ~ (home) directory type this:
Code: Select all
grep -w apt-get" .* | grep -v .bash_history
or
Code: Select all
alias | grep install
You can test aliases with putting them anywhere by using a "--norc option in bash with
Code: Select all
bash --norc
Code: Select all
alias install="sudo apt-get install"
Verify by typing
Code: Select all
alias install
Code: Select all
alias install='sudo apt-get install'
install <some_program>
Let us know...
Once it behaves as expected in the "bash --norc" environment, then move it to either .basrhrc
or another sourced file from .bashrc
NOTE: I declared this same alias like
Code: Select all
alias install="sudo apt-get install"
Code: Select all
alias install='sudo apt-get install'
Re: Alias problem
In fact, as I stated, a single line of "alias install='sudo apt-get install'" is all of my .bashrc.
And the following is the result that I checked by typing "alias"
====
'lias install='sudo apt-get install
====
Of course, if I directly type " alias install='sudo apt-get install' ", it worked very well as usual.
And the following is the result that I checked by typing "alias"
====
'lias install='sudo apt-get install
====
Of course, if I directly type " alias install='sudo apt-get install' ", it worked very well as usual.
Re: Alias problem
I have ~/.profile, which is following
Code: Select all
# 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
Re: Alias problem
Code: Select all
sehoonha@constantinople ~ $ grep -w lias ./.*
grep: ./.: Is a directory
grep: ./..: Is a directory
./.bash_history:grep -w lias ./.*
./.bash_history:grep -w lias ./.*
grep: ./.cache: Is a directory
grep: ./.cinnamon: Is a directory
grep: ./.config: Is a directory
grep: ./.dbus: Is a directory
grep: ./.dotfiles: Is a directory
grep: ./.dropbox: Is a directory
grep: ./.dropbox-dist: Is a directory
grep: ./.dropbox-master: Is a directory
grep: ./.emacs.d: Is a directory
grep: ./.gconf: Is a directory
grep: ./.gimp-2.8: Is a directory
grep: ./.gnome: Is a directory
grep: ./.gnome2: Is a directory
grep: ./.gnome2_private: Is a directory
grep: ./.linuxmint: Is a directory
grep: ./.local: Is a directory
grep: ./.mozilla: Is a directory
grep: ./.pki: Is a directory
grep: ./.semanticdb: Is a directory
grep: ./.smartgit: Is a directory
grep: ./.speech-dispatcher: Is a directory
grep: ./.subversion: Is a directory
grep: ./.thumbnails: Is a directory
grep: ./.Trash: Is a directory
sehoonha@constantinople ~ $
Re: Alias problem
Code: Select all
sehoonha@constantinople ~ $ grep -w alias ./.*
grep: ./.: Is a directory
grep: ./..: Is a directory
./.bash_history:alias
./.bash_history:alias
./.bash_history:alias
./.bash_history:alias
./.bash_history:alias
./.bash_history:alias
./.bash_history:alias
./.bash_history:alias
./.bash_history:alias make=
./.bash_history:alias
./.bash_history:alias make=make -j4
./.bash_history:alias
./.bash_history:alias make='make -j4'
./.bash_history:alias
./.bash_history:alias
./.bash_history:alias --help
./.bash_history:alias p
./.bash_history:alias -p
./.bash_history:alias
./.bash_history:alias
./.bash_history:alias
./.bash_history:alias
./.bash_history:alias
./.bash_history:alias
./.bash_history:alias
./.bash_history:alias
./.bash_history:alias
./.bash_history:alias
./.bash_history:alias
./.bash_history:alias
./.bash_history:alias
./.bash_history:alias
./.bash_history:locate alias
./.bash_history:alias
./.bash_history:alias
./.bash_history:alias
./.bash_history:alias
./.bash_history:alias
./.bash_history:alias
./.bash_history:alias
./.bash_history:alias
./.bash_history:alias
./.bashrc:alias install='sudo apt-get install'
grep: ./.cache: Is a directory
grep: ./.cinnamon: Is a directory
grep: ./.config: Is a directory
grep: ./.dbus: Is a directory
grep: ./.dotfiles: Is a directory
grep: ./.dropbox: Is a directory
grep: ./.dropbox-dist: Is a directory
grep: ./.dropbox-master: Is a directory
grep: ./.emacs.d: Is a directory
grep: ./.gconf: Is a directory
grep: ./.gimp-2.8: Is a directory
grep: ./.gnome: Is a directory
grep: ./.gnome2: Is a directory
grep: ./.gnome2_private: Is a directory
grep: ./.linuxmint: Is a directory
grep: ./.local: Is a directory
grep: ./.mozilla: Is a directory
grep: ./.pki: Is a directory
grep: ./.semanticdb: Is a directory
grep: ./.smartgit: Is a directory
grep: ./.speech-dispatcher: Is a directory
grep: ./.subversion: Is a directory
grep: ./.thumbnails: Is a directory
grep: ./.Trash: Is a directory
sehoonha@constantinople ~ $
Re: Alias problem
Call the alias something else, it might be due to the /usr/bin/install file
Re: Alias problem
@ sehoonha,WharfRat wrote:Call the alias something else, it might be due to the /usr/bin/install file
I tried the same alias as you and it worked. Are you sourcing anything in /etc/profile, /etc/profile.d/, /etc/bash.bashrc, ~/.bash_profile, ~/.bash_login, ~/.bashrc or ~/.profile
This is certainly odd