unix flavor cheatsheet
How to do various things under different unix flavors. In particular, helpful if you know one but not the other(s). For more cool comparisons, you can also try: http://www.bhami.com/rosetta.html
Configuring network devices
- Solaris
vi /etc/hostname.* vi /etc/hosts vi /etc/netmasks
- Debian:
vi /etc/network/interfaces
- Redhat:
cd /etc/sysconfig/network-scripts vi ifcfg-*
Bundled SSL certs
- rhel4:
up2date openssl ls -l /usr/share/ssl/cert.pem ls -l /usr/share/ssl/certs/ca-bundle.crt ls /usr/share/ssl/certs/
- rhel5
-
yum install openssl ls -l /etc/pki/tls/cert.pem ls -l /etc/pki/tls/certs/ca-bundle.crt ls /etc/pki/tls/certs
- Debian:
aptitude install ca-certificates ls /usr/share/ca-certificates
- OSX native
ls /System/Library/OpenSSL/certs
- OSX fink
fink install ca-roots ls /sw/etc/ssl/certs
Package management
- Solaris
## list installed pkgs: pkginfo ## look for a desired GT pkg: mount /ts_install; ls /ts_install/packages ## download and install a desired GT pkg: mount /ts_install; cd /ts_install/packages; instpkgs GTscreen ## remove an installed pkg: mount /ts_install; pkgrm -n -a /ts_install/packages/admin GTscreen ## detailed info on a pkg: pkginfo -l GTscreen ## list of files in a pkg: ~willday/bin/pkgfiles GTscreen egrep GTscreen /var/sadm/install/contents ## what pkg contains the file: ~willday/bin/pkgfiles -r /usr/local/bin/screen egrep /usr/local/bin/screen /var/sadm/install/contents
- Debian:
## list installed pkgs: dpkg -l COLUMNS=300 dpkg -l ## look for a desired pkg: dpkg -l "*ssh*" apt-cache search ssh ## download and install a desired pkg: aptitude install strace ## remove an installed pkg: aptitude purge strace ## detailed info on a pkg: dpkg -p coreutils ## list of files in a pkg: dpkg -L coreutils ## what pkg contains the file: dpkg -S /bin/ls ## update the OS aptitude update aptitude dist-upgrade
See also:
http://www.debian.org/doc/manuals/reference/ch-package.en.html
http://www.debian.org/doc/FAQ/ch-pkgtools.en.html
- Redhat (rhel generic):
## List installed pkgs: rpm -qa ## Remove an installed pkg: rpm -e strace ## Detailed info on a pkg: rpm -qi coreutils ## List of files in a pkg: rpm -ql coreutils ## What pkg contains the file: rpm -qf /bin/ls ## Remove a specific-architecture pkg: rpm -e e2fsprogs.i386 ## Check signature on a pkg rpm --checksig foo.rpm ## Import and trust a GPG key; NOTE if the key had been previously ## imported this *will* create a duplicate in the rpm db, ## which is a pain rpm --import foo.asc ## Remove a trusted signature, even if it's been imported multiple times rpm -e --allmatches gpg-pubkey-d763e80a-39c90df1 ## View all trusted GPG keys rpm --qa "gpg-pubkey*" ## View a specific trusted GPG key rpm -qi gpg-pubkey-db42a60e-37ea5438 ## Sign an rpm (replaces any existing signatures) rpm --resign foo.rpm
- Redhat (rhel4-specific):
## Update the OS up2date -u ## Look for a desired pkg: up2date --showall | egrep ssh ## Download and install a desired pkg: up2date strace ## Fetch an rpm file. Look in /var/spool/up2date. up2date --get strace
- Redhat (rhel5-specific):
## Update the OS yum update ## Look for a desired pkg: yum list all | egrep ssh ## Download and install a desired pkg: yum install strace
See also:
- Mac OSX
## list installed pkgs: ls /Library/Receipts ## list of files in a pkg: lsbom /Library/Receipts/Safari.pkg/Contents/Archive.bom

