Here are two interesting little tools, one of which should definitely be in your arsenal, and another that you still might find useful every now and again.
seq is, simply, a tool that prints out a sequence of numbers. For instance, run
seq -w 01 10
and it will output:
01 02 03 04 05 06 07 08 09 10
This is useful, for example, when you want to run a command that affects a bunch of hosts:
for k in `seq -w 0 10`; do ssh host0$k uptime; done
The -w option tells it to preserve width, so 00 is output instead of 0, for example.
Another tool that I’ve found useful is xxd. The short description of what it does is provide a hex dump of files.
[rmiller@pacific]# echo "hello world" > hello [rmiller@pacific]# xxd hello 0000000: 6865 6c6c 6f20 776f 726c 640a hello world.
But the good part about it is, you can use the -r option to recreate the file.
[rmiller@pacific]# xxd hello > hello.out [rmiller@pacific]# xxd -r hello.out hello world
So you can use this tool to byte edit files. One rather unusual use I’ve found for it is to paste in an RPM to a system that I only had serial console access to. I just ran xxd on it, copied it into the buffer, and pasted it into a file on the remote server. A quick xxd -r, and voila. RPM.
You could also do this via kermit and other related protocols, but those are so ancient I never bothered figuring them out…
Hope these are a couple of useful tools for you.