Handy commands that I keep forgetting

(my cheat sheet, this list will grow over time)


Solaris
dd if=boot.img of=/vol/dev/diskette0/unnamed_floppy bs=1440k        Make a boot floppy
dd if=$1 of=/vol/dev/aliases/floppy0 bs=1440k                                        Copy to floppy
snoop -td -V -x0 -d ipdptp0                                                                     Snoop the PPP interface (good opts)
tar cvfX -  /nogo . | rsh Moe dd of=/dev/rst4 > /backlog &                    Piping tar
tar cvfX /dev/rst18  /nogo .  > /backlog &                                                  Tape backup
HOST=`uname -n`; echo "\033]0;$1\007\c"                                            Set the window name on a xterm
share -o rw=Moe,root=Moe /4g                                                                 Share WITH root mountable (old)
share -o rw,anon=0 /4g                                                                                Share WITH root mountable (new)
setenv EDITOR vi; crontab -e                                                                   Edit the crontab with vi
crontab args are minute, hour, day of month, month of year, and day of week
/etc/shells                                                                                                        controls allowed ftp shells
/etc/defaultrouter                                                                                           default router
csh: set history=80                                                                                        set history list
csh:  set prompt="`/usr/ucb/hostname`[`whoami`]\!: "                         set the prompt
chmod modes: r=4, w=2, x=1
.netrc: machine <machine> login <userid> password <password>      Must be mode 600
 

Linux
mount -o ro -t iso9660 /dev/hdb /cdrom                                                    Mount a CDROM at hdb
mount -t msdos /dev/hda1 /dos                                                                    Mount the DOS partition
mount -t ext2 /dev/fd0 /floppy                                                                      Mount the floppy
/etc/exports: /opt   Moe(rw,no_root_squash)                                               export WITH root mountable

DNS
dig ns $1 @a.root-servers.net 
dig @$1 version.bind chaos txt 

DNS config options 

options {
          directory             "/dns";
          statistics-file       "named.stats";
          dump-file             "named_dump.db";
          notify                yes;
          recursion             yes;
          statistics-interval   60;
};

logging {
          channel bob_syslog {
            syslog   local4;
            severity info;
          };
          channel bob_dnslog {
            file "/logs/dnslog" versions 5 size 5M;
            // Set the severity to dynamic to see all the debug
messages.
            severity dynamic;
            print-category yes;
            print-severity yes;
            print-time     yes;
          };
          category default      { bob_syslog; };
          category panic        { bob_syslog; bob_dnslog; };
          category packet       { bob_dnslog; };
          category eventlib     { bob_dnslog; };
          category statistics   { bob_syslog; bob_dnslog; };
          category queries      { null; };
          category lame-servers { null; };
          category cname        { null; };
};

 
Copyright © 1993-2001 by Robert Barnes

Return to Unixhub's home page