Common Unix Commands

You might also like

You are on page 1of 13
Common Unix Commands Swap information regarding the swap area Bysinfo Display system information i.e cpu, memory, ete Services Display, start and stop services NES. Information on NFS i.e starting, stopping, etc Disk Displaying disk information i.e type, serial number, etc Kernel Modules Displaying and modifing kernel parameters Networking [Display and configuring network parameters Patching / Packages installing and removing patches and software packages [Accounts [Setting up and removing user accounts NTP ‘etwork Time Protocol ‘Log Files [Location to common log files Security (Security information Mise [Other stuff ic shutdown, timezone, run level, ete swap ‘Solaris Red Hat uP swap -1 at /proc/swaps (detailed) swapinfo (displayed in KB) Hisplay swap |wap -s swapon -S swapinfo -m (display in Mb) swapinfo -tm (total / Mb) ikfile Sm Hevice: |Create logical volume or filesystem Wvar/swapfile eate partition with fdisk (type 82) swap -a /var/swapfile |file: swapon | -f' ipdate /etc/vistab —_rount=65536 wapon -p 3 | -f' mkswap | swapon | lupdate /ete/fstab update /ete/fstab Note: -p = priority swap number removing ipdate /etcivistab —_|bwapofi' ' emove entry fiom /ete/fstab ap swap -d boot Remove device or file as normal I rtconf -D sysinfo ‘Solaris Red Hat ue ever type fusr/platform/“uname -1° jodel ‘yp /sbin/pridiag -v ame -a ridiag -v spei Hardware Info rtpicl -v [-c ] jsusb /ust/platform/“uname -r* at /procimeminfo (detailed) imesg | grep -i physical vat /proc/partitions (very high level) lemory sbin/pridiag -v free -om fusr/sam/Tbin/getmem prtconf| grep -i mem /optlignite/bin/print_manifest ‘ust/platform/"uname at /proc/epuinfo (detailed) /optiignite/bin/print_manifest ‘PU (type, number, ete) |/sbin/pridiag -v sam -> performance monitors -> system roperties format disk -1 joscan -funC disk privtoc fdisk -I (advanced server) Disk Drives arted print format -e (to convert EFI (zfs) to |partprobe MI) format \dparm -i /dev/hda iskinfo -v /devirdsk/c0t4d0 (detailed but no Disk serial Number, type, osat En \dparm -I dev/hda (detailed) serial number) te juxadm ing (ASx00 disk /optlignite/bin/print_manifest (no serial number) prays) cat /prociide/ideO/hda/model [prtvtoc fdisk -1 jifls -Clv fdisk -I (advanced server) Disk disk partitions \List Raw Partitions pia aw -qa a funefs fune2fs hunefs [Tune Filesystems fstyp -v une2fs -I /dev/sdal Kernel 32 or 64 lisainfo -kv (solaris 9+) uname -a etconf KERNEL BITS ( version 11) salist (spare v9 will be listed first) me -m etconf -a |grep -i ‘long bit’ HPUX < version 11 all 32 bit lote: determine if system supports 64 bit etconf HW_CPU_SUPP_BITS. Display Firmware [At the OK prompt type banner oot into the BIOS (normally F2 or F12) ‘orkstations: reboot inter PDC type: IN (information menu) ype: FV (Firmware Version) servers: russ -p trace -p Hownload and install tuse [Trace system calls luse -p ji isplay IRQ, IO ports and p= Procfinterrupts a prociioports MA procidma Services Solaris 10 [Red Hat splay services ves -a ervices ~-status-all Ja fisplay inetadm -1 tart services sveadm enable nfs service nfs start ia ‘stop services sveadm disable nfs service nfs stop ba reload service sveadm refresh nfs service nfs reload hia Festart service sveadm restart nfs service nfs restart va service status sves nfs service nfs staus Wa service dependencies sves -d network fa hia service dependants sves -D network fa pia var/svellog fa na service logging, ete ar/sve/manifest fib/svc/method NFS Solaris [Red Hat HP server: mountd, nfsd client: statd, lockd erver: rpe.mountd,nfsd client: rpe.statd, lockd erver: rpe.mountd, nfsd lient: rpe.statd, lockd (FS Daemons eteldfs/dfstab fetclexports etefdfi/sharetab isplay nfs sh shares showmount -¢ localhost Showmount -¢ localhost Sisplay nfs shares howmount -e localhost at /etc/xtab (currently exported) lereate nfs share jetc/dfs/dfstab (edit and add share) share redhat-config-nfs (GUI) ‘etc/exports (edit and add share) sbin/service nfs reload jetc/rc.config.d/nfsconf (edit) fetc/exports (edit and add share) exports -a luncreate nfs share mnshare jete/dfs/dfstab (edit and remove share) fetc/exports (edit and remove share) sbin/service nfs reload (ete/re.config.dinfsconf (edit) -xportf -au (unshare all) -xportts -u /home/vallep fetc/exports (edit and remove share) fetc/init.d/nfis.server start ete/init.d/nfs.client start sbin/service nfs start sbin/init.d/nfs.core start isbin/init. W/nfs.server start nfs start sbin/init.d/nfs.client start sveadm enable nfi/server wveadm disable nfs/server etc/init.dnfs.server stop sbin/service nfs stop sbin/init.d/nfs.client stop hhfs stop etc/init.d/nfs.client stop sbin/init.d/nfs.server stop sbin/init.d/nfs.core stop infs status 1s -ef]grep < nfs daemons> isbin/service nfs status -ef | grep nfs reload shareall sbin/service nfs reload -xportfs -a infs performanace ifsstat Infsstat ifsstat \List nfs clients that have remote mount |Cat /etc/rmtab at /ete/rmtab Disk |Solaris Red Hat |aP Display the boot device eprom cat /ete/grub.cont at fete/lilo.cont prub = grand unified boot loader ilo = linux loader setboot setting the boot device eteny boot-device | eprom boot-device | ete/grub.cont etc/lilo.conf setboot -p ‘etboot -a boot edromiaiskete (single \ser) ‘reating boot device installboot /usriplatform/" uname -i srub-install inkboot (MBR) ib/fs/ufs/bootblk ilo -v fdformat -v -U loppy ~-probe (use device a /olcheck -v tained below ) format floppy drive ewfs -v /vol/disk/aliases/floppy0 loppy ~-createrc > /etc/fd0 loppy --format /dev/fd0 inkis /dev/fd0 /olrmmount -I floppy0 mount /dev/fd0 /mnv/floppy —_|i/a mount/anmount floppy [ject floppy mount /mnt/floppy mount -F hsfs -o ro /edrom/edrom0 |mount -rt is09660 /devicdrom —_|mount -rF cdf /dev/dsk/e1t6d0 /edrom mount /edrom/edrom0 mnt/edrom mount/unmount CDROM mount /mnt/edrom tart: /usr/sbin/pps_mountd fetefinit.d/volmgr start sject edrom ps_mount sject cdrom fa inkbootdisk ‘uname -r° (boot __|fecovery tape (preview) reste boot disk or liskette) make_tape_recovery -v -I-x recovery tape inc_entire=vg00 foptlignite/bin/make_recovery -ACv > boot edrom -s finux single (at the boot prompt) enter PDC search ‘boot pl (cdrom) interact with IPL? Y SL> hpux -is boot into maintenace mode! 1k> boot -as 0 or £12 -boot pri interact with IPL? Y SL> hpux -Im Kernel Modules [Solaris Red Hat HP dingo at jproc/modules (more detailed) kkmadmin -k jsmod Hisplay loaded modules Location: [ib/modules!"uname -r'/kemel/drivers Inodload -p drvist modprobe kmadmin -L joad modules insmod jodunload -i drvist jodprobe -r madmin -U paload modules Immod kkmadmin -u it etc/sysctl.conf (edit and update then reboot) |keweb (L1i) fetc/system ysetl-p tune (11i only) eboot ;ebuild kemel (< 11i see below) ysetl -w param-value jo reboot (dynamically): et kernel parameters cho "250 32000 100 28" > proc/sys/kernel/sem ho "536870912" > proc’sys/kemnel/shmmax cho "4096" > /procisys/kemnel/sbmmni cho "2097152" > /proc/sys/kemel/shmall " pat /ete/system ysetl-a tune (Ii only) yysdet =i at /etc/sysctl.cont ysdet es =a kmtune isplay kernel at /prov/sys/kerneV/sem kmsystem rameters at /proc/sys/kernel/shmmax usr/sam/bin/getkinfo -f/stand/vmunix -0 fmp/kernel data pes -a build kernel dit and update file then _|ed /ust/sre/linux-2.4 reboot: fete/system «dit Makefile (change EXTRAVERSION) ake mrproper 3d /stand/build jusr/Ibin/sysadm/system_prep -s system. dit system file ackup .config just/sbin/mk_kemel -s ./system (hostname, ip address) ake xconfig wv /stand/system /stand/system.old ake dep v /stand/vmunix /stand/vmunix.old ake bzlmage v /stand/build/system /stand ake modules /stand/build/vmunix_test /stand/vmunix jove new kernel reboot jake modules_install change lilo/grub config file boot Networking ‘Solaris Red Hat aP Bas network information fetc/hostname.hme0 fetc/sysconfig/network jetc/rc.config.d/netconf default router fetc/defaultrouter dit /etc/sysconfiginetwork etcire.config.d/netcont \dd: GATEWAY= NIC speeds or Parameters kstat hme:0 starting and stopping a network |jfconfig qfe0 up /sbin/ifup eth ifconfig lan0 up terface feonfig qfe0 down /sbin/ifdown ethO ifconfig lan0 down \dd -get Inii-tool -v janadmin -x \dd -get dev/ip \? (list all params) thtool eth1 thtool -t eth0 online \dd -get \dd -get /dev/ip \? (ist all params) sysctl -a | grep net* «dd -set ii-tool -F 100baseTx-FD eth0 \dd -set setting NIC speed yaa) and update then thtool -s eth1 speed 100 duplex fulll}anadmin -X

You might also like