Useful Commands

If you constantly forget a command and need to reference it, here is a good place to deposit that information.

Command Lines

  • tar a directory: tar cfz filename.tar.gz directoryname
  • Check what is in a tar file: tar tfz filename.tar.gz
  • Uncompress and untar a file: tar -xzf filename.tar.gz
  • Zip a file: zip -r foo foo or zip stuff *
  • Disk Usage: du -ms .
  • Extract Java Files: jar -xvf filename.jar
  • Make cd and iso images:
    • mkisofs -o something.iso directory_name
    • cdrecord dev=15,0,0 driveropts=burnfree something.iso
  • Mount external hard drive: mount -t ntfs /dev/sd0e /mnt/scratch/harddisk/

Bits and Bytes

  • 1 bit = a 1 or 0 (b)
  • 4 bits = 1 nybble (?)
  • 8 bits = 1 byte (B)
  • 1024 bytes = 1 Kilobyte (KB)
  • 1024 Kilobytes = 1 Megabyte (MB)
  • 1024 Megabytes = 1 Gigabyte (GB)
  • 1024 Gigabytes = 1 Terabyte (TB)