UNIX General
- Untar a file? tar -xvf file_name
- View the contents of a tar file? tar -tvf file_name
- Change my shell? vipw
- Count the number of lines in a standard input? wc -l
- Commands to test SMTP server from telnet
- Reindex man pages? catman -w
- Find what processes have files in a mount point open? fuser -c file_system_name
- Leave a process running after logout? nohup sqlplus un/pw @script.sql > file.out 2>&1 &
- Redirect both stdout and stderr to a log file? script > log 2>&1
- Delete a file with a * at the end of its name? rm file\* or rm "file*"
- Create a file of a certain size? mkfile xM foo
- Find services enabled in inetd? grep -v "^#" /etc/inetd.conf
- Mail an attachment? uuencode filename filename | mailx -s "Here is file filename" recipient
- View reboots? last reboot
- Find all files owned by a user? find / -user UID
- Find listening ports? netstat -a | grep LISTEN
Linux
- Access files on a DOS partition? mount -t msdos /dev/hda1 /dos
- Find out what NFS shares a server is exporting? Showmount
- Stop/start/restart a service?
- Specify an additional nameserver? Nameservers are listed in the /etc/resolv.conf file.
- Specify IP and netmask of an ethernet device?
- Modify the /etc/sysconfig/network-scripts/ifcfg-eth#
- Specify the gateway address / hostname ?
- Specify a gateway? /etc/sysconfig/network file
- What PCI devices are on th bus? lspci
- Create a boot disk from a linux worksataion? dd if=/<path>/boot.img OB of=/dev/fd0
- Change the MAC address of a NIC card? /sbin/ifconfig eth0 hw ether 00:00:00:00:00:00
Solaris
- www.wins.uva.nl/pub/solaris/solaris2/
- Specify the gateway address?
- Console settings? 9600 8N1 No flow control VT100
- Users with an open file in a filesystem? fuser -c file_system_name
- Number of lines in a file? wc -l
- Modules are loaded in the kernel? modinfo
- Version of VXFS is running? Look at the loadable module modinfo | grep VXFS
- Status/number/speed of a processor. psrinfo -v
- Determine the run level of a system? who -r
- Display a disk label? prtvtoc
- ftp.cs.toronto.edu/pub/jdd/sun-managers/faq
- Files used in names resolution? resolv.conf nsswitch.conf
- Export a FS in Solaris? Add an entry to the /etc/dfs/dfstab file and restart NFS.
- Where FS are being exported? showmount -e
- Who has exported FSes mounted? showmount -a
- How much physical memory there is on a Solaris system? /usr/sbin/prtconf|grep Memory
- Spool console to a file? script file_name
- Bytes of swap space? swap -l * 512
- Installed OS patches? showrev -p
- Packages installed? pkginfo -i
- Display system settings for shmsys and semsys? sysdef
Windows
- List the shared resources of a server? net view \\server_name
- Display currently connected network drives? net use
- Map a network drive? NET USE device_name \\server_name\share_name /U:domain\user_name password
- Debug batch job scheduled to run using AT? AT hh:mi /interactive cmd.exe /k
- Grep for a regular expression? findstr string file_name
- Display processes using network ports? netstat -noa
- List running processes? tasklist
- Display the currently running services? net start
- Start/stop a service? net start/stop service_name
- Determine uptime of a server? Event log or uptime.exe
- View open ports? netstat -a
- MS Diagnonstics? winmsd
Oracle
- set pause on
- variable
- alter system flush shared_pool;
- You can also use DBMS_UTILITY.COMPILE_SCHEMA for re-compiling the whole schema.
- To check for existing errors on package SELECT name, type, text FROM dba_errors WHERE name = '';
- Check for non default init.ora values select name, value drom v$parameter where isdefault = 'FALSE' order by name;
- Start OMS? oemctrl start oms
- Status of OMS? oemctrl status oms sysman/passwd
- Stop OMS? oemctrl stop oms
- Start the agent on Unix? lsnrctl dbsmnp_start
- Start the agent on NT? net start oracle_agent_service
- Insert data with an ampersand? SET DEFINE OFF
- Change the defaul date display? alter session set nls_date_format = 'mm.dd.yy hh24:mi:ss';
- View text? set long 30000 select text from user_views where view_name=name
- Switch log file? alter system switch logfile
SQLPLUS
- Display all of the settings? show all
- Load file into the buffer? get file_name
- Avoid page breaks in result set? set pagesize 1000
- Avoid overlapping columns? set linesize 1000
- Format the length of a text column? column_name format a#
- Show invalid objects? select object_name from user_objects where status = 'INVALID'
- Concatenate a single tick? 2n+2 tick marks
- show errors for package package_name
- DEF[INE] {&|c|OFF|ON} Sets the character used to prefix substitution variables to c.
- --ON or OFF controls whether SQL*Plus will scan commands for substitution variables and replace them with their values.
- Double at sign? Looks for the command file in the same path as the file from which it is called
SSH
- Enable scp2 on OpenSSH? Subsystem sftp /path/to/sftp-server
CVS
- Print a list of modules without checking any out? checkout -c
- Diff two files? cvs diff -r 1.2 -r 3.4
- Retrieve version of the file from the head of the trunk? update -A
MySQL
- Display current user? select user();
- Display databases? show databases;
- Change database? use database_name;
Korn Shell
- Evaluate the exit code of the last command executed? echo $?
- Suspend the foreground program? CTRL-z
- Place program in background? bg
Veritas
- Verify the installed licenses for Veritas products? vxlicense -p
- How do you tell what version of VXFS is running? Look at the loadable module modinfo | grep VXFS
- Display all disk groups, including deported disk groups? vxdisk -o alldgs list
NTP
- Trace source of client's time? ntptrace
- Query a NTP server or client? ntpq
Vi
- Display current line number? ^G
- Global search and replace? :%s/find/replace/g
Misc
- Use wild cards in a FTP session? GLOB
- Google - sites linked? link:thesitename.com
- Google - domain search? searchword site:www.site.com