Check These Out
The original command is great, but I often want to prepend to every line.
Sometimes commands give you too much feedback.
Perhaps 1/100th might be enough. If so, every() is for you.
$ my_verbose_command | every 100
will print every 100th line of output.
Specifically, it will print lines 100, 200, 300, etc
If you use a negative argument it will print the *first* of a block,
$ my_verbose_command | every -100
It will print lines 1, 101, 201, 301, etc
The function wraps up this useful sed snippet:
$ ... | sed -n '0~100p'
don't print anything by default
$ sed -n
starting at line 0, then every hundred lines ( ~100 ) print.
$ '0~100p'
There's also some bash magic to test if the number is negative:
we want character 0, length 1, of variable N.
$ ${N:0:1}
If it *is* negative, strip off the first character ${N:1} is character 1 onwards (second actual character).
the command show can be run in vim, here is the same thing on the command line
$ cat script.pl | perl -MO=Deparse | perltidy
set how many commands to keep in history
Default is 500
Saved in /home/$USER/.bash_history
Add this to /home/$USER/.bashrc
HISTFILESIZE=1000000000
HISTSIZE=1000000
This is an alias you can add to your .bashrc file to get notified when a job you run in a terminal is done.
example of use
sleep 20; alert
Source:http://www.webupd8.org/2010/07/get-notified-when-job-you-run-in.html
top accecpts a comma separated list of PIDs.
That works in all softs, CLI or GUI... I don't want to waste time to all the time typing the same stuff . So, I have that command in my window manager shortcuts ( meta+l ). All the window managers have editable shortcuts AFAIK. If not, or you don't want to use it that way, you can easily use the xbindkeys soft.
I you're using kde4, you can run :
$ systemsettings
then open "inputs actions" and create a new shortcut.
For Gnome take a look there : http://www.cyberciti.biz/faq/howto-create-keyboard-shortcuts-in-gnome/
A more advanced one, with strings and newlines :
$ xvkbd -xsendevent -text "---8