Which one alias would you choose to keep if your .bash_alias/.bashrc/etc could only contain one line?
alias ss="script/server"
Clearly, I work in Rails most of the time. :)
alias prompt='PS1='\''[\e[7m]\u@\h \A $\w>[\e[27m] '\'''
It's just too difficult to type each time you log on, and all the other dbas don't like the oracle user to have a non-default prompt.
alias histgrep=history | grep
So I can find past commands very quickly by just typing
histgrep <part of command>
As well as
alias psgrep=ps -ef | grep
to quickly find out, if a specific process is still running.
alias ll="ls -al --color=auto"
The first thing I do when entering a new server; Gives much better readable dirlistings :)
My favourite is probably:
alias ff=find . -name $1
For more aliases, my complete bash profile is here
alias clean='rm -rf "#"* "."*~ *~ *.bak *.dvi *.aux *.log'
To clean unnecessary files from the current folder.
Not technically an alias, but it removes the need for a majority of them..
source /etc/bash_completion
alias sl=ls
How many times a day does your left hand get the "s" out before your right hand can get the "l" out? :)
here's my Windows "alias" that I put on all the Windows computers I use:
c:\windows\ls.bat
dir $1 $2 $3 $4
alias webshare='python -c "import SimpleHTTPServer;SimpleHTTPServer.test()"'
I use dvorak keyboard, so my most important one is:
alias no=ls -f
my other favorite is:
alias devn='cat > /dev/nul'
Which lets me type random crap to myself without worrying whether it will ever get saved...
My most frequently used ones:
alias la='ls -a -l'
alias ll='ls -l'
alias cats='konqueror http:'//icanhazcheezburger.com''
The last on is just a joke
sudo apt-get install trash-cli; alias rm=trash
I like it when destructive commands have undo buttons. It also makes deleting happen faster, and I don't have to specify -r
to delete recursively.
#Useful find command to grep recursively for a string, usage "f blah"
alias f='find . | tr "\n" "\0" | xargs -0 grep'
#Some handy backtracking commands
alias ..='cd ..'
alias ...='cd ../..'
alias ....='cd ../../..'
alias .....='cd ../../../..'
#Reload .bashrc good for when working with new aliases :-)
alias resource='source ~/.bashrc'
#Good if on cygwin and have notpad++ installed
alias edit='"/cygdrive/c/program files/notepad++/notepad++.exe"'
#This one prints out a treelike structure of directories.
alias tree='ls -R | grep ":$" | sed -e "s/:$//" -e "s/[^-][^\/]*\//--/g" -e "s/^/ /" -e s/-/|/"'
Found another handy one here on stackoverflow from Sanjaya R:
alias mkcd='_(){ mkdir $1; cd $1; }; _'
That's like mkdir foo; cd foo
by just calling mkcd foo
.
See the details on: http://stackoverflow.com/questions/941338/shell-script-how-to-pass-command-line-arguments-to-an-unix-alias/941390#941390