Article Title: common system status query commands in Linux. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
Lists all information related to each SCSI device, such as the logical unit number, hardware address, and device file name.
# Ps-ef
Lists information about all running processes, such as process numbers and process names.
# Netstat-rn
Lists the NIC status and route information.
# Netstat-in
Lists the NIC status and network configuration information.
# Df-k
Lists the loaded logical volumes and their sizes.
# Mount
Lists the loaded logical volumes and their locations.
# Uname-
Lists System ID, system name, OS version, and other information.
# Hostname
Lists system network names.
# Lsvg? L rootvg, lsvg? P rootvg
Displays logical volume group information, such as physical disks and logical volumes.
# Lslv? L datalv, lslv? P datalv
Displays various information about a logical volume, such as disks or images.
8 Network Fault Locating Methods
Diagnostic process for network disconnection:
Ifconfig)
Netstat? I view the NIC status
Whether Ierrs/Ipkts and Oerrs/Opkts are greater than 1%
Ping your NIC address (ip address)
Ping the IP address of another machine. If the IP address cannot be pinged, use diag to check whether the NIC is faulty.
In the same network, subnetmask should be consistent.
Basic Network Configuration Methods:
(1) to modify the network address and host name, use the chdev command.
# Chdev? L inet0? A hostname = myhost
# Chdev-l en0-a netaddr = '9. 3.240.58 '-a netmask = 255.255.255.0'
(2) view the NIC status: # lsdev? Cc if
(3) confirm the network address: # ifconfig en0
(4) Start the NIC: # ifconfig en0 up
(5) Configure routes
There are two ways to add a route:
Permanent route
# Chdev-l inet0-a route = '10. 47.0.0 ', '9. 3.240.59'
Temporary route
# Route add 10.47.1.2 9.3.240.59
Run netstat-rn to view the route table.
Appendix: List of Common commands:
Any XXXX, ####, ****, or X is to be substituted by a name, resource name or #, fn = filename DIR = Directory | = pipe symbol bosboot -a -d /dev/hdiskx -rebuilds boot record/image on boot device(hdiskx) cat -view contents of a file cat /tmp/****.1 -view a file, look at output cat fn fn > newfile -combines two files to a single file cd -will return you to default DIR cd / -will put in root DIR cd /xxxx -change you to a DIR anywhere is system cd .. -will drop you out of 1 DIR at a time cd xxxxx -will change you to a DIR in current dir cfgmgr -will auto config devices cfgmgr -v & -(-v) shows processes (&) puts in background chps -s xx hd# -increase paging space (xx=# of addt'l PPs) cp oldfn newfn -copy a file cp oldfn Dirn -copy a file to another directory crontab -l -list crontab entries for the current user ctrl + v -will page down 1 page ctrl + 6 -will page up 1 page del fn -same as rm -i,promts to remove fn df -I -shows status of file systems (no inodes) df -Ik -(k) show status in 1024 bites(1mb)(only AIX 4 diag -a -updates changes in hardware configuration diag ***** -****= a device type(as tape,disk....Fastpath) diag -cd rmtX -resets tape drive dosformat -formats a diskette to DOS dosdir -list files on dos formated diskette dosread XX YY -copies dos file XX to aix file YY doswrite YY XX -copies aix file YY to dos file XX errpt -generates a one line synopsis of logged errors errpt | pg -list errorlog 1 page @ a time(1st column is ID) errpt -a -displays detailed information of logged errors errpt -s Mmddhhmmyy -select entries posted later than date errpt -aj XXXXXXX -list detail error by ID number.(XXX=1st column) errpt -d S -list software errors errpt -j XXXXXXX -list summary report by ID number. errpt -aN XXXXXX -list detailed report by resource name column errpt -N XXXXXXX -list summary report by resource name column errclear 0 -clears errorlog errclear -N XXXXX 0 -clears errorlog by resource name, 0=all enter errclear -j XXXXX 0 -clears errorlog by ID number. finger -same as who but with more details flcopy -copies a diskette to another diskette format -formats a diskette in default diskette drive format -l -formats in lower denity: 1.44 on 2.44 / 720 on 1.44 hostname -responds with host system name host (hostname) -responds with internet address instfix -ik IPAR# -lists ipar fix was completely installed lppchk -v -checks install status of LPPs lppchk -v 2> /dev/lpX -sends output of lppchk to printer lpx lpstat -a all -view all printer queues lptest 80 5 > /dev/lp0 -send test pattern to lp0 ls -list names of files & directories in current dir ls -lia -list details of files, current dir & subdir ls -al -list details of files or dir in current dir lsattr -El xxxxxx -list specific settings on a device lsdev -C | sort -d -f -list system hardware (devices) lsdev -C | grep 00-0X -list resourses for a adapter lsdev -Cc xxxxx -H -list devices(xxx=tty,printer,disk,memory,adpt lsdev -Cs scsi -list scsi devices(not serial or raid) lsdev -Cc tape -list tape devices lsdev -Cs pci -list pci devices lsdev -Cs isa -list isa devices lscons -lists the assigned console lscfg -list hardware list (same as diags list) lscfg -rl mem* |pg -lists the memory on PCI bus machines lscfg -vl XXXXX -list config info from a device.(rmt0,hdisk,etc) lscfg -vl sysplanar0 -lists the machine type, model, s/n on SMP lsfs -list all filesystems + data from "df" cmd lslpp -l | grep BROKEN -lists incomplete ptfs lslv -m hd5 -finds boot drive under pv1 column lsps -a -checks available paging space lsps -s -checks available paging space lspv -lists information about the physical volumes lspv hdisk# -list drive info lspv -l hdisk# -lists logical volume group disk in lsuser -f ALL -lists all attributes for all users lsvg -lists volume groups lsvg -p XXXXXX -lists disks in volume group (xxxxx= volume name) more -reads files and displays the text one screen at a time. mpcfg -df -list all setting the machine is set to (smp) mpcfg -cf 11 1 -changes to fast IPL on SMP machines (smp) mv fn (path fn) -move and rename a file oslevel -shows AIX version (3.2.4 and above) pg -reads and displays text one screen at a time. pdisable -makes unavailable or shows all disabled tty's pdisable tty# -disables a tty penable -makes available or shows all enabled tty's penable tty# -enables a tty ps -el |pg -look at process running on system pwd -list what DIR you are currently in r -repeats last command rm -i ******* -remove a file & will prompt you if you are sure rmdev -l XXXXX -removes a device and defines it to data base rmdev -l XXXXX -d -removes a device and deletes it from data base set -o vi -sets up to veiw cammands that have been run :wq -write(save) and quit file Esc + k -used with SET command to list last command k,l -k=list next command ran, l=steps you thru command I -use with SET command inserts characters j -steps you backwards cw -cw=removes a word,just type in new word (use with Esc) a,x,r -a=added text, x=delete text, r=replace text(r+letter) R -lets you type over letters or words smit ***** -(*****= tape,disk,tty,etc.fastpath) su -stands for switch user,(NOT super user) su -switches to root id or prompts you for password su XXXXXX -switches to XXXXXX's id tar -cvf /dev/rmtX /etc -will copy /etc to a tape drive tar -tvf /dev/rmtX -will read a tape drive tctl -f /dev/rmtX rewoffl -rewind & eject tape tctl -f /dev/rmtX.1 fsf 3 -forward advances a tape to be read by TAR tctl -F -list avail commands(-F flag is not correct) tctl retension -retensions tape in tape drive & -put any command in background with process ID |