Check These Out
lists all files that are opened by processess named $processname
egrep 'w.+REG' is to filter out non file listings in lsof, awk to get the filenames, and sort | uniq to remove duplciation
You can also do this for seconds, minutes, hours, etc... Can't use dates before the epoch, though.
When expanding, bash output the command, so don't be affraid if you type the command.
Here is the details:
First examples:
$echo foo bar foobar barfoo
First argument:
$echo !$
echo barfoo
barfoo
(Note that typing echo foo bar foobar barfoo && echo !$, bash substitute !$ with $:1)
Last argument:
$echo foo bar foobar barfoo && echo !^
echo foo bar foobar barfoo && echo barfoo
foo bar foobar barfoo
barfoo
All the arguments:
$echo !*
echo foo bar foobar barfoo
foo bar foobar barfoo
The third argument:
$echo foo bar foobar barfoo && echo !:3
echo foo bar foobar barfoo && echo foobar
foo bar foobar barfoo
foobar
You may want to add {} for large numbers: echo !:{11} for example
Now with path:
$echo /usr/bin/foobar
/usr/bin/foobar
For the head:
$echo !$:h
echo /usr/bin
/usr/bin
And the tail:
$echo !$:t
echo foobar
foobar
You also may want to try !:h and !:t or !!3-4 for the third and the fourth (so !!:* == !!:1-$)
src: http://www.ibrahim-ahmed.com/2008/01/find-and-replace-in-multiple-files-in.html
If you try to access cd - you go to the last folder you were in.
This is useful for quickly jumping around branches in a file system, or operating on a parellel file.
This is tested in bash. cd to (substitute in PWD, a for b) where PWD is the bash environmental variable for the "working directory"
When your ssh session hanged (probably due to some network issues) you can "kill" it by hitting those 3 keys instead of closing the entire terminal.
This works just as well for SMTP. You could run this on your mail server to watch e-mail senders and recipients:
tcpdump -l -s0 -w - tcp dst port 25 | strings | grep -i 'MAIL FROM\|RCPT TO'