Check These Out
Using this command you can track a moment when usb device was attached.
This is useful if you add sid, install some packages, then remove sid and want to work out which packages you installed from sid that should be removed (e.g. before an upgrade to the new stable). Alternatively you can think of this as "find installed packages that can no longer be installed."
Put the positive clauses after the '-o' option.
Uses lsof to list open network connections (file descriptors), grepping for only those in an established state
This is a very hackish way to do it that I'm mainly just posting for fun, and I guess technically can more accurately be said to result in undefined behavior. What the command does is tell the shell to treat libpng like it's a shell plugin (which it's most certainly not) and attempt to install a "png_create_read" command from the library. It looks for the struct with the information about the command; since it's always the command name followed by "_struct", it'll look for a symbol called "png_create_read_struct". And it finds it, since this is the name of one of libpng's functions. But bash has no way to tell it's a function instead of a struct, so it goes ahead and parses the function's code as if it was command metadata. Inevitably, bash will attempt to dereference an invalid pointer or whatever, resulting in a segfault.
This replaces the current bash session with a new bash session, run as an interactive non-login shell... useful if you have changed /etc/bash.bashrc, or ~/.bashrc
If you have changed a startup script for login shells, use
$ exec bash -l
Suitable for re-running /etc/profile, ~/.bash_login and ~/.profile.
edit: chinmaya points out that
$ env - HOME=$HOME TERM=$TERM bash -s "exec bash -l"
will clear any shell variables which have been set... since this verges on unwieldy, might want to use
$ alias bash_restart='env - HOME=$HOME TERM=$TERM bash -s "exec bash -l"'
This will generate 3 paragraphs with random text. Change the 3 to any number.