Check These Out
This version uses Pipes, but is easier for the common user to grasp... instead of using sed or some other more complicated method, it uses the tr command
I often use it to find recently added ou removed device, or using find in /dev, or anything similar.
Just run the command, plug the device, and wait to see him and only him
mplayer -vo caca will give you a similar result but in color
This shell function displays a list of binaries contained in an installed package; works on Debian based Linux distributions.
I needed a way to search all files in a web directory that contained a certain string, and replace that string with another string. In the example, I am searching for "askapache" and replacing that string with "htaccess". I wanted this to happen as a cron job, and it was important that this happened as fast as possible while at the same time not hogging the CPU since the machine is a server.
So this script uses the nice command to run the sh shell with the command, which makes the whole thing run with priority 19, meaning it won't hog CPU processing. And the -P5 option to the xargs command means it will run 5 separate grep and sed processes simultaneously, so this is much much faster than running a single grep or sed. You may want to do -P0 which is unlimited if you aren't worried about too many processes or if you don't have to deal with process killers in the bg.
Also, the -m1 command to grep means stop grepping this file for matches after the first match, which also saves time.
host B (you) redirects a modem port (62220) to his local ssh.
host A is a remote machine (the ones that issues the ssh cmd).
once connected port 5497 is in listening mode on host B.
host B just do a
ssh 127.0.0.1 -p 5497 -l user
and reaches the remote host'ssh. This can be used also for vnc and so on.
Using this command you can track a moment when usb device was attached.
Some command names are very different from the name of the package that installed them.
Sometimes, you may want to find out the name of the package that provided a command on a system, so that you can install it on another system.
previous version leaves lots of blank lines
5 helpful aliases for using the which utility, specifically for the GNU which (2.16 tested) that is included in coreutils.
Which is run first for a command. Same as type builtin minus verbosity
$ alias which='{ command alias; command declare -f; } | command which --read-functions --read-alias'
Which (a)lias
$ alias whicha='command alias | command which --read-alias'
Which (f)unction
$ alias whichf='command declare -f | command which --read-functions'
Which e(x)ecutable file in PATH
$ alias whichx='command which'
Which (all) alias, function, builtin, and files in PATH
$ alias whichall='{ command alias; command declare -f; } | command which --read-functions --read-alias -a'
# From my .bash_profile http://www.askapache.com/linux-unix/bash_profile-functions-advanced-shell.html