Is there a simple way to list all the command conflicts that have occurred in the system due to the bashrc update involving alias commands?
For example, someone writes alias ls=/path/to/user-generated/executable in bashrc. How does one find out that this is masking an actual command (ls). One way seems to be to run all the aliases before and after sourcing bashrc and diff the output.
Alias are a great tool to help increment your productivity on the terminal with bash (or any shell program you’re using), but usually we are too lazy to think at what are the most common, or long commands that we use frequently and prepare an alias for them.
And so someone has done a small piece of software to do this job: aliaser
In my /home/user/.bashrc file, I have those aliases to prevent mistakes:
alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'
If I'm really sure of what I'm doing, I can overwrite rm and mv aliases using rm -f or mv -f, it will not ask me if I really want to overwrite files.
The problem, is that it doesn't work for the cp command, using cp -f will still ask me a question.
Is this normal?
alias bashrc='nano ~/.bashrc'
alias reload='source ~/.bashrc'
alias ls='ls --color=auto'
alias grep='grep -n --color=auto'
alias pacman='sudo pacman'
alias update='sudo pacman -Syu'
alias search='sudo pacman -Ss'
alias install='sudo pacman -S'
alias remove='sudo pacman -Rns'
alias makepkg='makepkg -s -
Possible Duplicate:
In Bash, when to alias, when to script, and when to write a function?
If I want to make a command like gsb that will expand to something like git show-branch -a | more or something even longer, what are the pros and cons of using a bash shell alias vs making a bash script and putting it on your PATH?
Are there any performance considerations?
Hello,
Upon a fresh install of Fedora 11 (and as a Fedora n00b), I noticed there are several aliases defined for me.
Code:
$ alias
alias l.='ls -d .* --color=auto'
alias ll='ls -l --color=auto'
alias ls='ls --color=auto'
alias vi='vim'
I am writing a bash script that runs each of its arguments as a command. This works for commands in my PATH, but not for aliases. I can directly call an alias in the script, but I can't call an alias that has been passed as an argument.
The problem (I assume) is that aliases are expanded before variables.
I have set some aliases in my .bashrc file and for some reason one of them does not behave as expected.
Since I don't remember the exact command assigned to that alias, I would like to see the command to find out what's wrong.
Except the obvious opening the .bashrc file to see it, is there a command that just echos the command assigned to that alias?
It's taken me almost 10 years of Linux usage to ask this question. It was all trial and error and random late-night internet surfing.
But people shouldn't need 10 years for this. If I were just starting out with Linux, I'd want to know: When to alias, when to script, and when to write a function?
Where aliases are concerned, I use aliases for very simple operations that don't take arguments.