I did this (was trying to set an 'self' alias with -v):
git() { if [[ $1 == "commit" ]]; then command git commit -v; else command git "$@"; fi; }
git() { if [[ $1 == "commit" ]]; then command git commit -v; else command git "$@"; fi; }
git() { git commit }; )
git() { git commit; }
git() { git (); }
git() { git(); }
git() { git() }
and now all git commmands hang - no error but no re
I am attempting to put some alias definitions in .bashrc. Like this:
#Convienience aliases
alias ll='ls -l'
alias ldir='ls -p | grep "/"'
#Temporary aliases
alias mvFooLog='mv ~/Projects/Foo/Log.txt .'
The last alias will work for me, but there seems to be some subtlety which is corrupting the definition of the first two.
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?
Suppose you have an alias go, but want it to do different things in different directories?
In one directory it should run cmd1, but in another directory it should run cmd2
By the way, I have an aliases for switching to the above directories already, so is it possible to append the go alias assignment to the foo alias?
alias "foo=cd /path/to/foo"
Working in bash(?) on OSX.
Let's say i have the following alias in bash - alias ls='ls --color=auto' - and i want to call ordinary ls without options. Is the only way to do that is to unalias, do the command and then alias again? Or there is some nifty trick or workaround?
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'
If one:
$ find -name 'some expression' -type f > newfile
and then subsequently wants to create an alias file from each pathname the find command retrieved and the > placed within 'newfile', how would one do this? Ideally, the newly created alias files would all be in one directory.
I am on a Mac OS X 10.7.
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 -
I tried this to set an alias:
alias lsf='ls -f'
and it works fine... But when I put it in a bash script it doesnt work.
SCRIPT:
cd ~
alias lsf='ls -F'
lsf
I get the following output:
line 3: lsf: command not found
Any ideas?