Couple of more bash commands…

Get your external IP address and other infos…
curl -> IP Adress
curl -> Remote Host
curl ->User Agent
curl -> Port

intercept stdout/stderr of another process
strace -ff -e trace=write -e write=1,2 -p SOME_PID

Delete all files in a folder that don’t match a certain file extension
Deletes all files in a folder that are NOT *.foo, *.bar or *.baz files. Edit the pattern inside the brackets as you like.
rm !(*.foo|*.bar|*.baz)

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.