Some Useful Command - Solaris _ Solaris

Embed Size (px)

DESCRIPTION

Useful command solaris

Citation preview

  • 5/28/2018 Some Useful Command - Solaris _ Solaris

    1/3

    1. df -n(or fstyp device) show type of file system (ufs/vxfs)

    2. fuserand pfilesopen files

    3. prtconf-VOBP level

    4. pgrep, pkill, prstat -aprocess info and manipulation

    5. logins -p|-dlocal users without passwords | duplicate uids

    6. mpstat, prtdiag, psrinfo -vprocessor information and more

    7. troff -man man.1 | dpost | lpprint old style man pages

    8. sgml2roff lpfilter.1m | troff -man | dpost | lp print

    sgml (new) man pages

    9. fstyp -vlist superblock including minfree %

    10.tputnice screen output

    11.what, ldd, stringsinformation about binaries

    12.ctrl-Vin vi insert control character

    13.ufsdump 0f - /filesystem | (cd /mnt; ufsrestore rf

    -); rm /mnt/restoresymtabledump restore pipe

    14.echo \007get bell to ring

    15.commcommon (non-common) lines from two files

    16.pkgchk -lp /usr/bin/lswhich package does ls belong to?

    17.df -oi -F ufsfree inodes icheck -b blockno filesystem

    block to file mapping

    18.dircmp, rsync, filesynccompare directories, sync utilities

    19.nohup /var/tmp/myscript.ksh > /var/tmp/myscript.out

    &for things which have to complete (no risk of terminal being logged

    out)

    20.netstat -pnarp like output when name services are down

    21.pwdx, pldd, ptreeand more in /usr/proc/bin

    22.uname -Xbasic system information - one item on each line (useful

    for scripts)

    23.readread a line

    24.listusersanother way of listing users

    25.tcopycopy tape

    26.nfsstat -m(or check /etc/rmtab) current nfs mount

    27.clear_locksclear nfs locks

    Some more useful commands.

    1. ps -efo vsz,pid,comm | sort rn (to see what processes are

    taking up the most memory)

    2. pfiles pid ( prints all open files of a process

    )

    3. /usr/ucb/ps uax |head ( top CPU users )

    4. /usr/ucb/ps vax |head ( top memory users )

    5. prtconf -vp | grep bootpath ( TO check the current physical

    path )

    6. prtconf -pv | grep banner-name |awk -F\' ' { print $2 } ' | head -1 (

    To check actual Machine model)

    7. prtpicl -v | grep wwn (Command to find persistent

    storage binding)

    8. grep "\-root" /var/adm/sulog | grep -v \+ | tail -25 List most

    recent attempts to switch to super user

    Some useful Command - Solaris

    Some useful Command - Solaris | Solaris http://solsupport.blogspot.com/2011/11/some-useful-command-solaris.html

    1 of 3 3/22/2014 12:43 PM

  • 5/28/2018 Some Useful Command - Solaris _ Solaris

    2/3

    9. stty sane (reset terminal )

    10. stty erase ^H ( Set the backspace to delete a character )

    11. find / -xdev -type f -ls|sort -nr -k 7,7 (Find largest file in a file

    system )

    12. find / -type f |xargs ls -s | sort -rn |more (Find files with most

    system spaces )

    13. find . -mtime -1 -type f (Find recently modified files )

    14. uuencode [filename] [filename] | mailx -s "Subject" [user to mail]

    Mail to user with attachement

    15. prtvtoc /dev/rdsk/c0t0d0s2 | fmthard -s - /dev/rdsk/c0t1d0s2 (

    Cloning Partition )

    16. mkisofs -l -L -r -o [image-name].iso [directory] (To create iso

    image of a directory )

    17. gzip -dc file1.tar.gz | tar xf - (Unpack .tar.gz file in place )

    ============================================================

    Install RMCmem Package : Explaining memory in Solaris by reviewing the different

    types of memory and introducing a set of tools,

    Download location : ftp://playground.sun.com/pub/memtool [ftp://playground.sun.com

    /pub/memtool] .

    # cd /tmp

    # zcat RMCmem3.8.2.tar.gz | tar xvf -

    # pkgadd -d .

    Virtual / Physical Memory Usage

    Solaris is a virtual memory system. The total amount of memory that you can use is

    increased by adding swap space to the system. If you ever see "out of memory"

    messages, adding swap space is the usual fix. Performance of the system is very

    dependent on how much physical memory (RAM) you have. If you don't have enough

    RAM to run your workload, performance degrades rapidly.

    Physical memory usage can be classified into four groups:

    Kernel memory mapped into kernel address space

    Process memory is mapped into a process address space

    Filesystem cache memory that is not mapped into any address space

    Free memory that is not mapped into any address space

    RMCmem includes a simple command to summarize this:

    # /opt/RMCmem/bin/prtmem

    Total memory: 989 Megabytes

    Kernel Memory: 60 MegabytesApplication: 110 Megabytes

    Executable & libs: 42 Megabytes

    File Cache: 757 Megabytes

    Free, file cache: 11 Megabytes

    Free, free: 6 Megabytes

    ============================================================

    ============================================================

    Determine the memory used by each Oracle background process on a Solaris

    ============================================================

    ================

    # ps -u oracle -f

    UID PID PPID C STIME TTY TIME CMD

    oracle 359 1 0 12:26:17 ? 0:00 ora_pmon_DIA3

    Some useful Command - Solaris | Solaris http://solsupport.blogspot.com/2011/11/some-useful-command-solaris.html

    2 of 3 3/22/2014 12:43 PM

  • 5/28/2018 Some Useful Command - Solaris _ Solaris

    3/3

    oracle 361 1 0 12:26:17 ? 0:01 ora_dbw0_DIA3

    oracle 363 1 0 12:26:17 ? 0:01 ora_lgwr_DIA3

    oracle 365 1 0 12:26:17 ? 0:18 ora_ckpt_DIA3

    oracle 367 1 0 12:26:17 ? 0:01 ora_smon_DIA3

    oracle 369 1 0 12:26:17 ? 0:00 ora_reco_DIA3

    oracle 371 1 0 12:26:17 ? 0:00 ora_snp0_DIA3

    oracle 373 1 0 12:26:17 ? 41:50 ora_s000_DIA3

    oracle 375 1 0 12:26:17 ? 0:00 ora_d000_DIA3

    oracle 377 1 0 12:26:18 ? 0:00 ora_d001_DIA3

    Second, you then enter the following commands for the DB Writer process

    (ora_dbw0_DIA3) with process id = 361 as an example.

    # /usr/proc/bin/pmap 361 | grep "shmid"

    80000000 82992K read/write/exec/shared [ shmid=0x2 ]

    # /usr/proc/bin/pmap 361 | grep "total"

    total 124232K

    Posted 5th November 2011 by Deepak Jha

    Comment as:

    Publish

    0 Add a comment

    Some useful Command - Solaris | Solaris http://solsupport.blogspot.com/2011/11/some-useful-command-solaris.html

    3 of 3 3/22/2014 12:43 PM