alias apt with auto complete kde 4 kubuntu


this is my way to type less on konsole

kate ~/.bashrc

add this shit here


alias u="sudo apt-get update"
alias g="sudo apt-get upgrade"
alias uf="echo sudo apt-get upgrade -f  && sudo apt-get upgrade -f"
alias gf="sudo apt-get dist-upgrade -f"
alias i="sudo apt-get install"
alias ai="apt-cache show"
alias li="dpkg --get-selections | grep -v deinstall"
alias r="sudo apt-get remove "
alias p="sudo apt-get --purge remove "
alias s="apt-cache search "
alias a="sudo apt-get autoremove"
alias save-apt-list="dpkg --get-selections | grep -v deinstall >$HOME/apt-list.lst ; echo saved on $HOME/apt-list.lst"
alias install-apt-list="sudo dpkg --set-selections < $HOME/apt-list.lst ; sudo apt-get -u dselect-upgrade"
alias h="echo \"
u			#update repository list			sudo apt-get update
g			#upgrade				sudo apt-get upgrade
uf			#force upgrade				sudo apt-get upgrade -f
gf			#force dist-upgrade			sudo apt-get dist-upgrade -f
i			#install packages			sudo apt-get install
ai			#information about the package		apt-cache show
li			#list packages installed		dpkg --get-selections | grep -v deinstall
r			#remove a package			sudo apt-get remove 
p			#remove a packate & conf file		sudo apt-get --purge remove 
s			#search for a software			apt-cache search 
a			#autoremove a software			sudo apt-get autoremove
save-apt-list		#save list of packages installed	dpkg --get-selections | grep -v deinstall >$HOME/apt-list.lst
install-apt-list	#install a list of packages in		sudo dpkg --set-selections < $HOME/apt-list.lst ; sudo apt-get -u dselect-upgrade\"
"
 peacefun()
{
	cur=`_get_cword`
	COMPREPLY=( $( apt-cache pkgnames $cur 2> /dev/null ) )
	return 0
	
} 

complete -F peacefun $filenames ai 
complete -F peacefun $filenames i 
complete -F peacefun $filenames s 
complete -F peacefun $filenames p 
complete -F peacefun $filenames r

Now reload the bash profile with this suckor

source ~/.bashrc

now try to do

i blen TAB TAB TAB

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: