Check These Out
This will save your open windows to a file (~/.windows).
To start those applications:
$ cat ~/.windows | while read line; do $line &; done
Should work on any EWMH/NetWM compatible X Window Manager.
If you use DWM or another Window Manager not using EWMH or NetWM try this:
$ xwininfo -root -children | grep '^ ' | grep -v children | grep -v '' | sed -n 's/^ *\(0x[0-9a-f]*\) .*/\1/p' | uniq | while read line; do xprop -id $line _NET_WM_PID | sed -n 's/.* = \([0-9]*\)$/\1/p'; done | uniq -u | grep -v '^$' | while read line; do ps -o cmd= $line; done > ~/.windows
ps returns all running processes which are then sorted by the 4th field in numerical order and the top 10 are sent to STDOUT.
This command can be used to extract the title defined in HTML pages
Nasty perl one-liner that provides a sparkline of ping times. If you want a different history than the last 30, just put that value in. It (ab)uses unicode to draw the bars, inspired by https://github.com/joemiller/spark-ping . It's not the most bug-free piece of code, but what it lacks in robustness it makes up for in capability. :)
If anyone has any ideas on how to make it more compact or better, I'd love to hear them.
I included a ping to google in the command just as an example (and burned up 10 chars doing it!). You should use it with: $ ping example.com | $SPARKLINE_PING_COMMAND
You're running a program that reads LOTS of files and takes a long time.
But it doesn't tell you about its progress.
First, run a command in the background, e.g.
$ find /usr/share/doc -type f -exec cat {} + > output_file.txt
Then run the watch command.
"watch -d" highlights the changes as they happen
In bash: $! is the process id (pid) of the last command run in the background.
You can change this to $(pidof my_command) to watch something in particular.
This comes in handy if you have daemons/programs that have potential issues and stop/disappear, etc., can be run in cron to ensure that a program remains up no matter what. Be advised though, if a program did core out, you'd likely want to know why (gdb) so use with caution on production machines.
Shows all block devices in a tree with descruptions of what they are.
This will probably kill any user sessions and/or ssh connections to other servers you might have active.
Some conf file are very long (squid.conf) This command help to read it.