On Sat, Dec 25, 2010 at 3:26 PM, Narendra Sisodiya
<nare...@narendrasisodiya.com> wrote:
add this to your ~/.bashrc file
apt-get-search() {
aptitude search $1 | sed -e 's/^i.*//g' | sed '/^$/d'
}
close and open the terminal again [or just source ~/.bashrc]
After that you will be able to search like
apt-get-search games
apt-get-search hindi
apt-get-search graphics
this trick has been added to schoolOS bashrc bydefault..
OR Better in this way - because aptitude search only in package name...
apt-get-search() {
dpkg --get-selections | sed -ne 's/\t\t*install$//p' > /tmp/ListInstalled
apt-cache search $1 | cut -d" " -f1 | sort > /tmp/ListMatched
cat /tmp/ListInstalled /tmp/ListMatched | sort | uniq -d > /tmp/ListInstalledFromSearch
diff /tmp/ListInstalledFromSearch /tmp/ListMatched | grep ">" | cut -d" " -f2 > /tmp/ListAvailable
for i in $(cat /tmp/ListAvailable); do aptitude search $i; done
}
If you know any better method to do then let us know..
Thanks