May 2008

The Archives

  • 05.24.08
    Search backwards in history cmd | pfortuny | (0)
    (This is not a command 'stricto sensu' but a must-know). Assume you are in the shell, after some work. If you press CTRL-r, you enter the incremental history search mode: you just type something you remember you typed and the last executed command containing it appears. Then you either press ENTER to execute the line or the right arrow to edit it or CTRL-r again to continue the search. Try it and enjoy.
  • 05.19.08
    Executing a command in a loop with a delay cmd | n0str0m0 | (2)
    This command executes a command in a loop with the specified delay. Useful for instance if you want to monitor the status of your machine (disk space, network status...) $ watch -n 4 du -ch . The command above, executes "du -ch ." every four seconds. Note: That's a GNU command. Under FreeBSD watch is a completely different program. In order to use the GNU watch command, you have to install the gnu-watch package. Note 2: If you don't like watch you can always do something like this: $ while true; do command; sleep delay; done but watch is shorter XD
  • 05.13.08
    An IP Network/broadcast/etc calculator cmd | rafacas | (0)
    $ ipcalc 192.168.0.100 255.255.255.192 Address: 192.168.0.100 11000000.10101000.00000000.01 100100 Netmask: 255.255.255.192 = 26 11111111.11111111.11111111.11 000000 Wildcard: 0.0.0.63 00000000.00000000.00000000.00 111111 => Network: 192.168.0.64/26 11000000.10101000.00000000.01 000000 HostMin: 192.168.0.65 11000000.10101000.00000000.01 000001 HostMax: 192.168.0.126 11000000.10101000.00000000.01 111110 Broadcast: 192.168.0.127 11000000.10101000.00000000.01 111111 Hosts/Net: 62 ...