Created
March 14, 2016 09:49
-
-
Save comm1x/182561cc596703391078 to your computer and use it in GitHub Desktop.
PT - alias wrapper for apt-get, apt-cache commands
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
cmd=$1 | |
arguments=${@:2} | |
if [[ $cmd = "install" ]]; then | |
command sudo apt-get install $arguments | |
exit 0 | |
fi | |
if [[ $cmd = "show" ]]; then | |
command apt-cache show $arguments | |
exit 0 | |
fi | |
if [[ $cmd = "search" ]]; then | |
command apt-cache search --names-only $arguments | |
exit 0 | |
fi | |
if [[ $cmd = "update" ]]; then | |
command sudo apt-get update | |
command sudo apt-get upgrade | |
command sudo apt-get autoremove | |
exit 0 | |
fi | |
if [[ $cmd = "installed" ]]; then | |
command apt list --installed *$arguments* | |
exit 0 | |
fi | |
echo "Usage: pt {install,update,show,search,installed}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment