Debian sapt
Do you find your self struggling with typing apt-cache search the whole time. It’s too time consuming and its easy to make a typo, typing in the whole string. There are quicker and easier ways accomplishing the same thing.
There should be a shortcut to this command if you ask me, nice thing is we can create it ourselfs. It would be nice just to be able to type in something simple like search-apt or even simpler sapt packagename, in fact it is pretty easy to make something like this.
There are a couple of ways doing the same thing. Here are a few ways of doing it.
Alias
The first method is using the aliasing mechanism. You can put this alias in your /etc/profile or perhaps in your ~/.profile or your what ever your shell reads upon login e.g. ~/.bashrc, what ever suites you best.
$ alias sapt='apt-cache search $*'
$ sapt irb
irb - Interactive Ruby (irb)
irb1.6 - Interactive Ruby (irb) 1.6.x
lg-issue88 - Issue 88 of the Linux Gazette.
irb1.8 - Interactive Ruby (for Ruby 1.8)
As we can see it works perfectly, now lets put it in the /etc/profile file.
$ echo -e "\nalias sapt='apt-cache search \$*'" |sudo tee -a /etc/profile
# Alias 'apt-cache search' into a single sapt command
alias sapt='apt-cache search $*'
Bash Script
You could also create a bash script, and place it in something like /usr/local/sbin/sapt, ofcourse make sure that /usr/local/sbin is in your $PATH environment variable.
$ sudo tee /usr/local/sbin/sapt << EOF
> #!/bin/sh
> apt-cache search \$*
> EOF
#!/bin/sh
apt-cache search $*
$ sudo chmod +x /usr/local/sbin/sapt
Now you can do:
$ sapt irb
irb - Interactive Ruby (irb)
irb1.6 - Interactive Ruby (irb) 1.6.x
lg-issue88 - Issue 88 of the Linux Gazette.
irb1.8 - Interactive Ruby (for Ruby 1.8)
While I’m a pretty fast typer, but this still saved me a lot of time.

