Translate

Friday 31 January 2014

SYSTEM COMMANDS


kill -<Signal> <process>
- sends a signal (normally a kill) to a process. kill -9 terminates the job no questions asked, kill -15 tries to clear up as much as possible - e.g. remove semaphores and such-like. Other signals may be sent as well, see manual and /usr/include/sys/signal.h to see what signals you can send to a process.
renice <priority> <process>
- make a process not hog the system so much by setting its nice value.
smit
- system admin program for AIX
df
- list volume groups + usage. see also lsvg. Usually used with the -k flag so the number of blocks is displayed in 1024-blocks.
cu -l <device>
- log on to device such as a pad or a modem. See related files /etc/uucp/* and /etc/locks and /etc/services
stty sane
- Changes terminal settings back to normal. If a tetra module for example crashes your screen so that no keys function except ^C which doesn't even do very much then typing ^Jstty sane^J should cure the problem. To fully cure the problem you also need to type stty tab3 (and stty -ixon if you're feeling a little overzealous)
stty
- allows you to change terminal settings such as the interrupt key, quit key, etc. e.g.
$ stty intr ^A # would change the interrupt key to being control-A
$ stty quit ^L #would set the quit key (normally ^\) to control-L. other key changes are:
  • erase (normally ^H)
  • xon (normally ^Q)
  • xoff (normally ^S)
  • eof (normally ^D)
To really annoy a systems administrator, change interrupt to 't' and quit to '^D' . hehehehehehe
lscfg
- show all connected devices
lsvg
- list volume groups (see related file diskhelp)
lspv
- list physical disks (and see related file diskhelp)
lspv without arguments will produce a list of all the hard-disks used. lspv <hard-disk-name> will produce a list of information about the hard disk. lspv -l <hard-disk-name> will show any logical volumes which are mapped on to that drive.
lsdev
- list devices. Options:
  • -C list Configured devices
  • -P list Possible devices
produces different output when you are root.
mkdev
- make devices. e.g. To make a tty:
# Script to add a tty. Options that need amending are:
# -l name of tty to be created - e.g '-l tty600' wil create
# a tty called 'tty600'
# -p RAN name
# -w Port number on RAN
# -a Attributes (e.g. to set up auto login, etc.)
mkdev -c tty -t 'tty' -s 'rs232' -l tty433 -p sa2 -w 2 -a term='wyse50' -a forcedcd='enable' -a login='enable' -a speed='19200'
e.g. To create a printer (raw device):
mkdev -c printer -t 'osp' -s 'rs232' -p 'sa3' -w '10' -l label2 -a xon='yes' -a dtr='no' -a col=500
It is highly recommended that you make and change devices using smit
chdev
- change devices. See mkdev
cc
- c compiler, use with
  • -o <object> to specify a target instead of a.out
  • -O optimise
  • -w or -W all warning flags.
shutdown
- shutdown the system so that it may be switched off. Rather obviously, this may only be run by root. Options:
  • -f shuts the system down immediately (rather than waiting for a minute)
  • -R reboot the system immediately after halt
oslevel
- show the current revision of the operating system.

No comments:

Post a Comment