BigAdmin System Administration Portal
Shell Commands

Show me commands that deal with:

Additional Resources
1.  Click here for more information All Solaris Commands * 2005-08-09
2.  Click here for more information Alphabetical Directory of Linux Commands * 2008-05-29
3.  Click here for more information Comparision of Shell commands (PDF) * 2005-11-19
4.  Click here for more information Cool Commands * 2006-05-15
5.  Click here for more information coolcommands.com * 2005-10-13
6.  Click here for more information DOS to UNIX command translation * 2006-02-09
7.  Click here for more information Korn Shell Nuances * 2006-11-07
8.  Click here for more information Man Pages: System Administration Commands (Solaris 10) 2006-02-14
9.  Click here for more information Man Pages: System Administration Commands (Solaris 9) 2006-02-14
10.  Click here for more information Man Pages: User Commands (Solaris 10) 2006-02-14
11.  Click here for more information Man Pages: User Commands (Solaris 9) 2006-02-14
12.  Click here for more information Tips on good shell programming practices * 2006-03-10
13.  Click here for more information Trapping Special Characters in the Korn Shell * 2005-10-13
14.  Click here for more information Universal Command Guide for Operating Systems * 2005-01-19
15.  Click here for more information Useful Solaris Commands (Blog) * 2006-11-16

Back to top

 

Debugging
16.  Click here for more information cat -v -t -e [file]
/* Show non-printing characters */
2006-06-20
17.  Click here for more information dumpadm -d swap
/* Configure swap device as dump device */
2005-02-16
18.  Click here for more information ld -l <libname without 'lib'>
/* Check if you have a particular library */
2005-03-30
19.  Click here for more information truss -f -p <pid of a shell>
/* Using multiple windows, this can be used to trace setuid/setgid programs */
2005-03-22
20.  Click here for more information truss executable
/* Trace doing of given command ( useful debugging ) */
2005-03-22

Back to top

 

Disk Commands
21.  Click here for more information /bin/mount -F hsfs -o ro /dev/sr0 /cdrom
/* Mount an ISO 9660 CDROM */
2005-03-22
22.  Click here for more information /usr/bin/iostat -E
/* Command to display drives statistics */
2005-03-22
23.  Click here for more information du -ad /var | sort -nr
/* Report the the disk used in /var in reverse order */
2005-03-22
24.  Click here for more information du -k .
/* Report disk usage in Kilobytes */
2005-03-22
25.  Click here for more information du -sk * | sort -nr | head
/* Shows the top ten largest files/directories */
2005-01-19
26.  Click here for more information du -sk *|sort -k1,1n
/* Reports total disk space used in Kilobytes in present directory */
2005-03-22
27.  Click here for more information du -sk .
/* Report total disk usage in Kilobytes */
2005-03-22
28.  Click here for more information fdformat -d -U
/* Format diskette */
2005-03-22
29.  Click here for more information mount -F hsfs -o ro `lofiadm -a /export/temp/software.iso` /mnt
/* Mount an ISO Image */
2007-10-23
30.  Click here for more information newfs -Nv /dev/rdsk/c0t0d0s1
/* To view the superfblocks available */
2005-03-22
31.  Click here for more information One-liner to copy a partition table
/* prtvtoc /dev/dsk/c1t2d0s2 | fmthard -s - /dev/rdsk/c1t3d0s2 */
2007-05-30
32.  Click here for more information prtvtoc /dev/rdsk/c0t0d0s2
/* Disk geometry and partitioning info */
2005-03-22
33.  Click here for more information prtvtoc /dev/rdsk/c0t0d0s2 | fmthard -s - /dev/rdsk/c0t1d0s2
/* Copy partition table from one disk to another */
2005-12-16
34.  Click here for more information quot -af
/* How much space is used by users in kilobytes */
2005-03-22
35.  Click here for more information volrmmount -i floppy
/* Mount a floppy or other media easily by its nickname. */
2005-08-03

Back to top

 

Driver Parameters
36.  Click here for more information ndd /dev/ip ip_forwarding
/* Show the ip_forwarding variable in the kernel */
2005-03-22
37.  Click here for more information ndd /dev/ip ip_forwarding 1
/* Set the ip_forwarding variable in the kernel */
2005-03-22
38.  Click here for more information ndd /dev/ip \?
/* Show all IP variables set in the kernel */
2005-03-22

Back to top

 

File Manipulation
39.  Click here for more information dos2unix | -ascii <filename>
/* Converts DOS file formats to Unix */
2005-03-22
40.  Click here for more information fold -w 180
/* To break lines to have maximum char */
2005-07-26
41.  Click here for more information split [-linecount] [file]
/* Split files into pieces */
2005-03-22
42.  Click here for more information [vi] : %s/existing/new/g
/* Search and Replace text in vi */
2005-03-22
43.  Click here for more information [vi] :set list
/* Show non-printing characters in vi */
2006-04-10
44.  Click here for more information [vi] :set nu
/* Set line numbers in vi */
2005-03-22
45.  Click here for more information [vi] :set ts=[num]
/* Set tab stops in vi */
2005-03-22

Back to top

 

File System
46.  Click here for more information /sbin/uadmin x x
/* Syncs File Systems and Reboots systems fast */
2005-03-22
47.  Click here for more information awk ' END {print NR}' file_name
/* Display the Number of lines in a file */
2005-08-03
48.  Click here for more information cat /dev/null > filename
/* Zero's out the file without breaking pipe */
2005-03-22
49.  Click here for more information dd if=/dev/rdsk/... of=/dev/rdsk/... bs=4096
/* Make a mirror image of your boot disk */
2005-03-22
50.  Click here for more information df -k | grep dg| awk '{print $6}' |xargs -n 1 umount
/* Unmount all file systems in disk group dg */
2005-03-22
51.  Click here for more information fsck -F ufs -o b=97472 /dev/rdsk/c0t0d0s0
/* Check and repair a UFS filesystem on c0t0d0s0, using an alternate superblock */
2005-03-22
52.  Click here for more information fsck -F ufs -y /dev/rdsk/c0t0d0s0
/* Check a UFS filesystem on c0t0d0s0, repair any problems without prompting. */
2005-03-22
53.  Click here for more information fsck -F ufs /dev/rdsk/c0t0d0s0
/* Check a UFS filesystem on c0t0d0s0 */
2005-03-22
54.  Click here for more information gzip -d -c tarball.tgz | (cd /[dir];tar xf - ) &
/* Unpacking tarballs to diff location */
2005-03-22
55.  Click here for more information gzip -dc file1.tar.gz | tar xf -
/* Unpack .tar.gz files in place */
2005-03-22
56.  Click here for more information ln [-fhns] <source file> <destination file>
/* Creating hard links and soft links */
2005-03-22
57.  Click here for more information ls -al | awk '$3 == "oracle" || $3 == "root" {print $9}'
/* List all file names by testing owner */
2005-08-03
58.  Click here for more information ls -l | sort +4n
/* List files by size */
2005-08-09
59.  Click here for more information ls -la | awk '{ print $5,"    ",$9 }' | sort -rn
/* File sizes of current directory */
2005-03-22
60.  Click here for more information ls -lR | awk '{total +=$5};END {print "Total size: " total/1024/1024 "MB" }'
/* Recursive directory size calculations in MB */
2005-08-03
61.  Click here for more information mkisofs -l -L -r -o [image-name].iso [directory]
/* Create an ISO image of a directory */
2006-03-06
62.  Click here for more information mount -F ufs -o rw,remount /
/* Used to remount root to make it writeable */
2005-03-22
63.  Click here for more information mount -o remount,logging /spare
/* Re-mount the ro file system rw and turn on ufs logging */
2005-03-22
64.  Click here for more information mount DOS fdisk partition from Solaris
/* mount -f pcfs /dev/dsk/c0d0p1 /export/dos */
2005-03-22
65.  Click here for more information mv [filename]{,.new_suffix}
/* Renaming file */
2006-06-20
66.  Click here for more information pax -rw . /newdir
/* Efficient alternative for copying directories */
2005-03-22
67.  Click here for more information prtvtoc /dev/rdsk/c0t0d0s2 | fmthard -s - /dev/rdsk/c0t1d0s2
/* Cloning Partitiontables */
2005-03-22
68.  Click here for more information rpm -q --queryformat '%{INSTALLPREFIX}\n' [packagename]
/* [Linux] Locate binaries */
2005-08-16
69.  Click here for more information tar cf - . | (cd /newdir ; tar xf -)
/* Recursively copy files and their permissions */
2005-03-22
70.  Click here for more information tar cvf filename.tar
/* Create a tape (tar) archive */
2005-03-22
71.  Click here for more information tar xvf filename.tar
/* Extract a tape (tar) archive */
2005-03-22
72.  Click here for more information X=$(wc -l < filename); echo $X
/* Count number of lines in a file into a variable (ksh) */
2005-02-06
73.  Click here for more information zcat <patch_file.tar.Z | tar xvf -
/* Extract the patch_file that is a compressed tar file */
2005-03-22
74.  Click here for more information zcat [cpio file] | cpio -itmv
/* Show the contents of a compressed cpio */
2005-08-17

Back to top

 

File Transfer
75.  Click here for more information find . -depth | cpio -pdmv /path/tobe/copied/to
/* Fast alternative to cp -pr */
2005-03-22
76.  Click here for more information find . -follow | cpio -pdumL /path/tobe/copied/to
/* Copy with symbolic links to be followed */
2006-02-16
77.  Click here for more information get filename.suffix |"tar xf -"
/* Undocumented Feature of FTP */
2005-03-22
78.  Click here for more information Move any file(s) without actually touching them
/* ssh cd /some/directory \&\& tar cf - | ssh cd /some/direstory \&\& tar xvf - */
2005-12-01
79.  Click here for more information put "| tar cf - ." filename.tar
/* Undocumented Feature of FTP */
2005-03-22
80.  Click here for more information sendport
/* FTP command for transferring large numbers of files within the same control session */
2005-03-22

Back to top

 

General
81.  Click here for more information /bin/printf '%d\n' '0x<hex>'
/* Converts hexadecimal number to decimal. */
2005-03-30
82.  Click here for more information /usr/bin/catman -w
/* Create windex databases for man page directories */
2005-03-22
83.  Click here for more information echo 'obase=16;255' | bc
/* Simple way to convert decimal to hex */
2007-01-31
84.  Click here for more information FQ_FILENAME=<fully_qualified_file_name>; echo ${FQ_FILENAME%/*}
/* Extract directory from fully-qualified file name. */
2005-03-22
85.  Click here for more information mailx -H -u <username>
/* List out mail headers for specified user */
2005-03-22
86.  Click here for more information ps -ef | grep -i $@
/* Access common commands quicker */
2006-02-16
87.  Click here for more information set filec
/* Set file-completion for csh */
2005-03-22
88.  Click here for more information uuencode [filename] [filename] | mailx -s "Subject" [user to mail]
/* Send files as attachments */
2005-03-22
89.  Click here for more information xauth -f /home/${LOGNAME} extract - ${DISPLAY} | xauth merge -
/* Allow root to xdisplay after su */
2006-09-12

Back to top

 

Hardware
90.  Click here for more information cfgadm
/* Verify reconfigurable hardware resources */
2005-03-22
91.  Click here for more information m64config -depth 8|24
/* Sets the screen depth of your M64 graphics accelerator */
2005-03-22
92.  Click here for more information m64config -prconf
/* Print M64 hardware configuration */
2005-03-22
93.  Click here for more information m64config -res 'video_mode'
/* Change the resolution of your M64 graphics accelerator */
2005-03-22
94.  Click here for more information prtpicl -v | grep sync-speed
/* Discover SCSI sync speed */
2005-04-26

Back to top

 

Kernel
95.  Click here for more information /usr/sbin/modinfo
/* Display kernel module information */
2005-03-22
96.  Click here for more information /usr/sbin/modload <module>
/* Load a kernel module */
2005-03-22
97.  Click here for more information /usr/sbin/modunload -i <module id>
/* Unload a kernel module */
2005-03-22
98.  Click here for more information /usr/sbin/sysdef
/* Show system kernal tunable details */
2005-03-22
99.  Click here for more information nm -x /dev/ksyms | grep OBJ | more
/* Tuneable kernel parameters */
2005-03-22
100.  Click here for more information update_drv -f [driver name]
/* Force a driver to reread it's .conf file without reloading the driver */
2008-06-17 - New/Updated

Back to top

 

Memory
101.  Click here for more information pagesize -a
/* Available page sizes for Solaris 9 */
2005-06-08
102.  Click here for more information prtconf | grep Mem
/* Display Memory Size of the local machine. */
2005-03-22

Back to top

 

Network Information
103.  Click here for more information arp -a
/* Ethernet address arp table */
2005-03-22
104.  Click here for more information arp -d myhost
/* Delete an ethernet address arp table entry */
2005-03-22
105.  Click here for more information lsof -iTCP@10.20.2.9
/* Display open files for internet address */
2006-04-03
106.  Click here for more information named-xfer -z qantas.com.au -f /tmp/allip
/* Get All IP Addresses On A DNS Server */
2007-02-21
107.  Click here for more information ndd /dev/arp arp_cache_report
/* Prints ARP table in cache with IP and MAC address */
2005-03-22
108.  Click here for more information netstat -a | grep EST | wc -l
/* Displays number active established connections to the localhost */
2005-03-22
109.  Click here for more information netstat -a | more
/* Show the state of all the sockets on a machine */
2005-03-22
110.  Click here for more information netstat -i
/* Show the state of the interfaces used for TCP/IP traffice */
2005-03-22
111.  Click here for more information netstat -k hme0
/* Undocumented netstat command */
2005-03-22
112.  Click here for more information netstat -np
/* Similar to arp -a without name resolution */
2005-03-22
113.  Click here for more information netstat -r
/* Show the state of the network routing table for TCP/IP traffic */
2005-03-22
114.  Click here for more information netstat -rn
/* Displays routing information but bypasses hostname lookup. */
2005-03-22
115.  Click here for more information snoop -S -ta [machine]
/* Snoop for network packets and get size and time stamp entries. */
2005-11-04
116.  Click here for more information traceroute <ipaddress>
/* Follow the route to the ipaddress */
2005-03-22

Back to top

 

Network Tuning
117.  Click here for more information /sbin/ifconfig hme0:1 inet 10.210.xx.xxx netmask 255.255.0.0 broadcast 10.210.xxx.xxx
/* Virtual Interfaces */
2005-03-22
118.  Click here for more information /sbin/ifconfig hme0:1 up
/* Bring virtual interface up */
2005-03-22
119.  Click here for more information /usr/sbin/ndd -set /dev/hme adv_100fdx_cap 1
/* Nailling to 100Mbps */
2005-03-22
120.  Click here for more information ifconfig eth0 10.1.1.1 netmask 255.255.255.255
/* Add an Interface */
2005-03-22
121.  Click here for more information ifconfig eth0 mtu 1500
/* Change MTU of interface */
2005-03-22
122.  Click here for more information ndd -set /dev/ip ip_addrs_per_if 1-8192
/* To set more than 256 virtual ip addresses. */
2005-03-22
123.  Click here for more information ndd -set /dev/tcp tcp_recv_hiwat 65535
/* Increase TCP-receivebuffers on Sol2.5.1 systems with 100BaseTx */
2005-03-22
124.  Click here for more information ndd -set /dev/tcp tcp_xmit_hiwat 65535
/* Increase TCP-transmitbuffers on Sol2.5.1 systems with 100BaseTx */
2005-03-22

Back to top

 

Processes
125.  Click here for more information /usr/proc/bin/ptree <pid>
/* Print the parent/child process 'tree' of a process */
2005-03-22
126.  Click here for more information /usr/proc/bin/pwdx <pid>
/* Print the working directory of a process */
2005-03-22
127.  Click here for more information /usr/ucb/ps -aux | more
/* Displays CPU % usage for each process in ascending order */
2005-03-22
128.  Click here for more information /usr/ucb/ps -auxww | grep <process name>
/* Gives the full listing of the process (long listing) */
2005-03-22
129.  Click here for more information coreadm -i core.%f.%p
/* Append program name and process id to core file names */
2007-04-11
130.  Click here for more information fuser -uc /var
/* Processes that are running from /var */
2005-03-22
131.  Click here for more information ipcs
/* Report inter-process communication facilities status */
2005-03-28
132.  Click here for more information kill -HUP `ps -ef | grep [p]roccess | awk '{print $2}'`
/* HUP any related process in one step */
2005-03-22
133.  Click here for more information lsof -i TCP:25
/* Mapping port with process */
2006-02-22
134.  Click here for more information pfiles <pid>
/* Shows processes' current open files */
2005-03-22
135.  Click here for more information pkill -n <name>
/* Kill a process by name */
2005-03-22
136.  Click here for more information prstat -a
/* An alternative for top command */
2005-03-22
137.  Click here for more information ps -edf -o pcpu,pid,user,args
/* Nicely formatted 'ps' */
2006-03-06
138.  Click here for more information ps -ef | grep -i <string> | awk '{ print $2 }'
/* Creates list of running PID by <string> */
2005-03-22
139.  Click here for more information ps -ef | grep -i <string> | awk '{ print $2 }'
/* Creates list of running PID by */
2005-03-22
140.  Click here for more information ps -ef | grep <process name> | grep -v grep | cut -c 10-15 | xargs kill -9
/* Find and kill all instances of a given process */
2005-12-01
141.  Click here for more information ps -ef | more
/* Show all processes running */
2005-03-22
142.  Click here for more information ps -ef|grep -v "0:00"|more
/* Gives you a list of any process with CPU time more than 0:00 */
2005-03-22
143.  Click here for more information ps -eo pid,args
/* List processes in simplified format */
2005-03-22
144.  Click here for more information ps -fu oracle|grep pmon
/* See which instances of Oracle are running */
2005-03-22
145.  Click here for more information top -b 1
/* Returns the process utilizing the most cpu and quits */
2005-03-22

Back to top

 

Resource Management
146.  Click here for more information /usr/bin/ldd [filename]
/* List the dynamic dependencies of executable files */
2005-03-22
147.  Click here for more information /usr/proc/bin/pmap pid
/* Report address space map a process occupies */
2005-03-22

Back to top

 

Route Configuration
148.  Click here for more information route add net 128.50.0.0 128.50.1.6 1
/* Add a route to the routing table */
2005-03-22
149.  Click here for more information route change 128.50.0.0 128.50.1.5
/* Changes the destination address for a route */
2005-03-22
150.  Click here for more information route delete net 128.50.0.0 128.50.1.6
/* Delete a route from the routing tab