Some Common AIX/Unix Commands

Contributor Icon Contributed by seamonkey420 Date Icon August 13, 2004  
Tag Icon Tagged: Korn shell

This is more of an ingredients list than a true recipe.
Here are some common AIX commands that i’ve come to love and hate.


• lsps –a list paging space
• lsattr –El mem0 list current physical memory
• extendlv hd6 16 doubled paging space from 512MB to 1024MB
(only use with IBM direction)
• smit lsmksysb (list files on a tape from a mksysb)
• lsdev –Cc disk (shows all disk drives)
• lscfg –vl hdisk1 (shows info on individual disk drives, s/n, p/n, etc…)
• lspv shows disks installed on system
• df –k (shows file system size information)
• lp filename (prints file to network printer)
• lpstat (shows print jobs)
• cancel # (cancels print job by #, found with lpstat)
• enq –U (restarts print que if status shows it is down–must be root)
• enq –Q prtx -#xxx (redirects a print job to another print que)
• ps –ef (shows current system processes)
• errpt –a (shows system error report including power outages)
• errclear 0 (completely clears the system errlog viewed with errpt –a)
• errclear –N sysplanar0 0
(clears only select items specified by the resource name, ex: sysplanar0)
• diag (system diagnostics, use the advanced diagnostics section, this helps determine the exact cause of a problem like sysplana0, queries system errlog for info)
• sort –o list list (stores the sorted output of list back into list)
• sort –u list (sorts and eliminates duplicate lines)
• grep –vxf combinedlist masterlist (lists of #’s in masterlist not found in combinedlist)
ex: combinedlist=mulitple distribution lists containing SAs already downloaded to masterlist=list of all SA salons
this grep will list out the salons in the masterlist that haven’t been downloaded to.
• tail –f filename shows last ten lines of a file and monitors for any updates
• lsattr –El sys0 | grep maxuproc shows maximum number of processes allowed for any one users (this can be increased by going into “smit system”)
• lsvg –l rootvg (displays disk info including number of logical and physical partitions for each file system. PPs should be double that of LPs if disk is mirrored)
• comm -12 file1 file2 shows only what lines are in both file1 and file2. (sort both files before running the command) (the -12 suppress columns 1 and 2, what is only in file1 and only in file2)
• wc filename (lists number of lines, number of words, number of characters in file, useful for distribution lists, can use –c for characters, -w for words, or –l for lines [eg. wc –l filename, etc] )
• df –Ik shows filesystem disk space; total, used and free (no Inodes).
• (in vi) :r filename reads in the contents of a file.
• (in vi) :r !command reads in the output of a command.
• (in vi) yy p (copy and paste) – yy = yank, p = paste below line, P = paste above line.
• (in vi) dd p (cut and paste) – dd = cut, p = paste below line, P = paste above line.
• Ksh –n filename checks for syntax errors in korn shell programs
• cfgmgr command to get system to recognize new hardware (can be run while system is running – a system boot runs it 3 times)
• cfgmgr –i /dev/cd0 installs drivers from cd for new hardware (best method)
• lscfg –vp|grep CL shows current firmware version
• instfix –i | grep –i aix shows maintenance level for AIX
• oslevel –r shows operating system level with maintenance level
• nslookup server name shows the ip address of the server name as it is on the network’s DNS server via the RS6000’s /etc/resolv.conf file. If it can’t resolve the server name, either the “name server” is stopped on the RS6000 (no resolv.conf file present) or there is something wrong with the DNS.
• /etc/netsvc.conf file containing hosts=local,bind4 this will force the RS6000 to first use the /etc/hosts file and then the DNS if it can’t find it in /etc/hosts. Other wise it will check in the DNS only (if name server is started on the RS6000) and never the hosts file. ???
• lssrc –g nfs use to check if nfs service is currently running.
• stopsrc –g nfs use to stop nfs service – (change rcnfs from wait to off in /etc/inittab to prevent it from starting during boo

Previous recipe | Next recipe |
 

close Reblog this comment
blog comments powered by Disqus