Sponsored Content
Top Forums UNIX for Advanced & Expert Users export UNIX95=1 in a script?? Post 302071220 by x96riley3 on Thursday 13th of April 2006 11:39:33 AM
Old 04-13-2006
-o is the ps format option in Solaris.

[root@server]/var/tmp>
usage: ps [ -aAdeflcjLPy ] [ -o format ] [ -t termlist ]
[ -u userlist ] [ -U userlist ] [ -G grouplist ]
[ -p proclist ] [ -g pgrplist ] [ -s sidlist ]
'format' is one or more of:
user ruser group rgroup uid ruid gid rgid pid ppid pgid sid taskid
pri opri pcpu pmem vsz rss osz nice class time etime stime
f s c lwp nlwp psr tty addr wchan fname comm args projid project pset
[root@server]/var/tmp>
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

script to export variables

Hi, I am a newbie to unix as well as scripting. I need to write a script, which on execution sets the necessay oracle variables. Can someone help me out as to how to proceed? also can u suggest good tutorial for bash/shell scripting? thanks (1 Reply)
Discussion started by: aboxilica
1 Replies

2. UNIX for Dummies Questions & Answers

export script commands with xterm

I am attempting to write a shell script that runs a program which generates data and then runs another program to plot the data. The problem is that I need the plotting to take place in a different terminal window that stays open after the plotting has finished. I have experimented 'xterm -e '... (1 Reply)
Discussion started by: chris2051
1 Replies

3. Shell Programming and Scripting

Use of export from a shell script..

Hi All, I am facing a problem while trying to export path variables from a script. Here's my situation 1. I have a script in which i have defined all the path variables to be exported: export ORACLE_HOME=/path/to/bin/ export NG_USER_HOME=/path/to/bin/ etc.... 2. I have another shell... (4 Replies)
Discussion started by: raghu_shekar
4 Replies

4. Shell Programming and Scripting

Export from perl script

Hi, Want to initaite the Oracle's Export utility from the perl script,but getting error as mentioned below: Script #!/usr/bin/perl -w my $username="system"; my $password = "manager"; my $tns = "DBLOCAL"; exp $username/$password@$tns Error $ ./testexp.pl Array found where... (4 Replies)
Discussion started by: milink
4 Replies

5. UNIX for Advanced & Expert Users

Bash script with export variables

Hi all guys, how you can read in thread title, I'm deploying a bash script in which I have to export some variables inside it. But (I think you know) the export command works only inside the script and so, on exit command, the variables aren't set like I set inside the script. Consequently in... (8 Replies)
Discussion started by: idro
8 Replies

6. UNIX for Dummies Questions & Answers

Export script to current session

Hi, I have a script called bash$> cat -ev setprofile.sh alias rm='rm -i'$ $ The alias does not take effect unless i run the script as bash$> . ./setprofile.sh What do I have to do in-order to simply run (9 Replies)
Discussion started by: shifahim
9 Replies

7. Shell Programming and Scripting

Script for Export backup!!

Dear Team, Can you please help me to write the script for export backup. I've written some of the part and stuck in "if" condition Apprecatied if you help me. Requirement:- Export backup completion sent the email if it is success (sent backup success email)or if fails (sent backup fails... (9 Replies)
Discussion started by: Mohammed Fareed
9 Replies

8. Shell Programming and Scripting

export repository shell script

Hi Forum, I have script to export he Siebel repository. My requirment is to have a shell script in place so when placed in it in a cron it should generate the repsoitory dat file on date basis. Script for export: repimexp /a E /c UCM_ES_DEV2_DSN /u sadmin /p SADMIN /d siebel /r... (4 Replies)
Discussion started by: nuthakki
4 Replies

9. Shell Programming and Scripting

Export Error in Shell script

All, While executing the bellow commnad after the sed, awk command to export the value to, i am getting the fallowing error. line="_AABBB.EEEEEEE.LOG4JDISPLAY.PATH_=/apps/opt/abcde/pdstdsd/esapp/apadsfasdf/logadsfasdf.xml" keystring=`echo $line | awk -F"=" '{ print $1 }'`... (1 Reply)
Discussion started by: jothi basu
1 Replies

10. UNIX for Dummies Questions & Answers

Export emails into spreadsheet (script)

I 'd like to export emails from my mail client(mac) inbox into an Excel spreadsheet. I need the Subject, From fields, Return-Path and the Message-ID. Does anyone know how I can do this? Thanks, Newbie :) (1 Reply)
Discussion started by: Cris
1 Replies
PS(1)							    BSD General Commands Manual 						     PS(1)

NAME
ps -- process status SYNOPSIS
ps [-AaCcehjlmrSsTuvwx] [-k key] [-M core] [-N system] [-O fmt] [-o fmt] [-p pid] [-t tty] [-U username] [-W swap] ps -L DESCRIPTION
ps displays a header line followed by lines containing information about running processes. By default, the display includes only processes that have controlling terminals and are owned by your uid. The default sort order of controlling terminal and (among processes with the same controlling terminal) process ID may be changed using the -k, -m, or -r options. The information displayed for each process is selected based on a set of keywords (see the -L, -O, and -o options). The default output for- mat includes, for each process, the process' ID, controlling terminal, CPU time (including both user and system time), state, and associated command. The options are as follows: -A Display information about all processes. This is equivalent to -a -x. -a Display information about other users' processes as well as your own. Note that this does not display information about processes without controlling terminals. -C Change the way the CPU percentage is calculated by using a ``raw'' CPU calculation that ignores ``resident'' time (this normally has no effect). -c Do not display full command with arguments, but only the executable name. This may be somewhat confusing; for example, all sh(1) scripts will show as ``sh''. -e Display the environment as well. The environment for other users' processes can only be displayed by the super-user. -h Repeat the information header as often as necessary to guarantee one header per page of information. -j Print information associated with the following keywords: user, pid, ppid, pgid, sess, jobc, state, tt, time, and command. -k Sort the output using the space or comma separated list of keywords. Multiple sort keys may be specified, using any of the -k, -m, or -r options. The default sort order is equivalent to -k tdev,pid. -L List the set of available keywords. -l Display information associated with the following keywords: uid, pid, ppid, cpu, pri, nice, vsz, rss, wchan, state, tt, time, and command. -M Extract values from the specified core file instead of the running system. -m Sort by memory usage, equivalent to -k vsz. -N Extract the name list from the specified system instead of the default ``/netbsd''. Ignored unless -M is specified. -O Display information associated with the space or comma separated list of keywords specified. The -O option does not suppress the default display; it inserts additional keywords just after the pid keyword in the default display, or after the pid keyword (if any) in a non-default display specified before the first use of the -O flag. Keywords inserted by multiple -O options will be adjacent. An equals sign (``='') followed by a customised header string may be appended to a keyword, as described in more detail under the -o option. -o Display information associated with the space or comma separated list of keywords specified. Use of the -o option suppresses the set of keywords that would be displayed by default, or appends to the set of keywords specified by other options. An equals sign (``='') followed by a customised header string may be appended to a keyword. This causes the printed header to use the specified string instead of the default header associated with the keyword. Everything after the first equals sign is part of the customised header text, and this may include embedded spaces (`` ''), commas (``,''), or equals signs (``=''). To specify multiple keywords with customised headers, use multiple -o or -O options. If all the keywords to be displayed have customised headers, and all the customised headers are entirely empty, then the header line is not printed at all. -p Display information associated with the specified process ID. -r Sort by current CPU usage. This is equivalent to -k %cpu. -S Change the way the process time is calculated by summing all exited children to their parent process. -s Display one line for each LWP, rather than one line for each process, and display information associated with the following keywords: uid, pid, ppid, cpu, lid, nlwp, pri, nice, vsz, rss, wchan, lstate, tt, time, and command. -T Display information about processes attached to the device associated with the standard input. -t Display information about processes attached to the specified terminal device. Use a question mark (``?'') for processes not attached to a terminal device and a minus sign (``-'') for processes that have been revoked from their terminal device. -U Displays processes belonging to the user whose username or uid has been given to the -U switch. -u Display information associated with the following keywords: user, pid, %cpu, %mem, vsz, rss, tt, state, start, time, and command. The -u option implies the -r option. -v Display information associated with the following keywords: pid, state, time, sl, re, pagein, vsz, rss, lim, tsiz, %cpu, %mem, and command. The -v option implies the -m option. -W Extract swap information from the specified file instead of the default ``/dev/drum''. Ignored unless -M is specified. -w Use 132 columns to display information instead of the default, which is your window size. If the -w option is specified more than once, ps will use as many columns as necessary without regard to your window size. -x Also display information about processes without controlling terminals. A complete list of the available keywords are listed below. Some of these keywords are further specified as follows: %cpu The CPU utilization of the process; this is a decaying average over up to a minute of previous (real) time. Since the time base over which this is computed varies (since processes may be very young) it is possible for the sum of all %CPU fields to exceed 100%. %mem The percentage of real memory used by this process. flags The flags (in hexadecimal) associated with the process as in the include file <sys/proc.h>: P_ADVLOCK 0x00000001 process may hold a POSIX advisory lock P_CONTROLT 0x00000002 process has a controlling terminal P_NOCLDSTOP 0x00000008 no SIGCHLD when children stop P_PPWAIT 0x00000010 parent is waiting for child to exec/exit P_PROFIL 0x00000020 process has started profiling P_SELECT 0x00000040 selecting; wakeup/waiting danger P_SINTR 0x00000080 sleep is interruptible P_SUGID 0x00000100 process had set id privileges since last exec P_SYSTEM 0x00000200 system process: no sigs or stats P_TIMEOUT 0x00000400 timing out during sleep P_TRACED 0x00000800 process is being traced P_WAITED 0x00001000 debugging process has waited for child P_WEXIT 0x00002000 working on exiting P_EXEC 0x00004000 process called execve(2) P_OWEUPC 0x00008000 owe process an addupc() call at next ast P_FSTRACE 0x00010000 tracing via file system P_NOCLDWAIT 0x00020000 no zombies when children die P_32 0x00040000 32-bit process (used on 64-bit kernels) P_BIGLOCK 0x00080000 process needs kernel ``big lock'' to run P_INEXEC 0x00100000 process is exec'ing and cannot be traced lim The soft limit on memory used, specified via a call to setrlimit(2). lstart The exact time the command started, using the ``%C'' format described in strftime(3). nice The process scheduling increment (see setpriority(2)). rss the real memory (resident set) size of the process (in 1024 byte units). start The time the command started. If the command started less than 24 hours ago, the start time is displayed using the ``%l:%M%p'' for- mat described in strftime(3). If the command started less than 7 days ago, the start time is displayed using the ``%a%p'' format. Otherwise, the start time is displayed using the ``%e%b%y'' format. state The state is given by a sequence of letters, for example, ``RWNA''. The first letter indicates the run state of the process: D Marks a process in disk (or other short term, uninterruptible) wait. I Marks a process that is idle (sleeping for longer than about 20 seconds). O Marks a process running on a processor. R Marks a runnable process, or one that is in the process of creation. S Marks a process that is sleeping for less than about 20 seconds. T Marks a stopped process. U Marks a suspended process. Z Marks a dead process (a ``zombie''). Additional characters after these, if any, indicate additional state information: + The process is in the foreground process group of its control terminal. - The LWP is detached (can't be waited for). < The process has raised CPU scheduling priority. a The process is using scheduler activations. E The process is trying to exit. K The process is a kernel thread or system process. l The process has multiple LWPs. N The process has reduced CPU scheduling priority (see setpriority(2)). s The process is a session leader. V The process is suspended during a vfork(2). X The process is being traced or debugged. tt An abbreviation for the pathname of the controlling terminal, if any. The abbreviation consists of the two letters following ``/dev/tty'', or, for the console, ``co''. This is followed by a ``-'' if the process can no longer reach that controlling terminal (i.e., it has been revoked). wchan The event (an address in the system) on which a process waits. When printed numerically, the initial part of the address is trimmed off and the result is printed in hex, for example, 0x80324000 prints as 324000. When printing using the command keyword, a process that has exited and has a parent that has not yet waited for the process (in other words, a zombie) is listed as ``<defunct>'', and a process which is blocked while trying to exit is listed as ``<exiting>''. ps will try to locate the processes' argument vector from the user area in order to print the command name and arguments. This method is not reliable because a process is allowed to destroy this information. The ucomm (accounting) keyword will always contain the real command name as contained in the process structure's p_comm field. If the command vector cannot be located (usually because it has not been set, as is the case of system processes and/or kernel threads) the command name is printed within square brackets. To indicate that the argument vector has been tampered with, ps will append the real command name to the output within parentheses if the basename of the first argument in the argument vector does not match the contents of the real command name. In addition, ps checks for the following two situations and does not append the real command name parenthesized: -shellname The login process traditionally adds a '-' in front of the shell name to indicate a login shell. ps will not append parenthesized the command name if it matches with the name in the first argument of the argument vector, skipping the leading '-'. daemonname: current-activity Daemon processes frequently report their current activity by setting their name to be like ``daemonname: current-activity''. ps will not append parenthesized the command name, if the string preceding the ':' in the first argument of the argument vector matches the command name. KEYWORDS
The following is a complete list of the available keywords and their meanings. Several of them have aliases (keywords which are synonyms). %cpu percentage CPU usage (alias pcpu) %mem percentage memory usage (alias pmem) acflag accounting flag (alias acflg) comm command (the argv[0] value) command command and arguments (alias args) cpu short-term CPU usage factor (for scheduling) cpuid CPU number the current process or lwp is running on. ctime accumulated CPU time of all children that have exited egid effective group id egroup group name (from egid) emul emulation name etime elapsed time since the process was started, in the form [[dd-]hh:]mm:ss euid effective user id euser user name (from euid) flags the process flags, in hexadecimal (alias f) gid effective group id group group name (from gid) groupnames group names (from group access list) groups group access list inblk total blocks read (alias inblock) jobc job control count ktrace tracing flags ktracep tracing vnode laddr kernel virtual address of the struct lwp belonging to the LWP. lid ID of the LWP lim memory use limit lname descriptive name of the LWP logname login name of user who started the process (alias login) lstart time started lstate symbolic LWP state majflt total page faults minflt total page reclaims msgrcv total messages received (reads from pipes/sockets) msgsnd total messages sent (writes on pipes/sockets) nice nice value (alias ni) nivcsw total involuntary context switches nlwp number of LWPs in the process nsigs total signals taken (alias nsignals) nvcsw total voluntary context switches nwchan wait channel (as an address) oublk total blocks written (alias oublock) p_ru resource usage pointer (valid only for zombie) paddr kernel virtual address of the struct proc belonging to the process. pagein pageins (same as majflt) pgid process group number pid process ID ppid parent process ID pri scheduling priority re core residency time (in seconds; 127 = infinity) rgid real group ID rlink reverse link on run queue, or 0 rlwp Number of LWPs on a processor or run queue rss resident set size rsz resident set size + (text size / text use count) (alias rssize) ruid real user ID ruser user name (from ruid) sess session pointer sid session ID sig pending signals (alias pending) sigcatch caught signals (alias caught) sigignore ignored signals (alias ignored) sigmask blocked signals (alias blocked) sl sleep time (in seconds; 127 = infinity) start time started state symbolic process state (alias stat) stime accumulated system CPU time svgid saved gid from a setgid executable svgroup group name (from svgid) svuid saved uid from a setuid executable svuser user name (from svuid) tdev control terminal device number time accumulated CPU time, user + system (alias cputime) tpgid control terminal process group ID tsess control terminal session pointer tsiz text size (in Kbytes) tt control terminal name (two letter abbreviation) tty full name of control terminal uaddr kernel virtual address of the struct user belonging to the LWP. ucomm name to be used for accounting uid effective user ID upr scheduling priority on return from system call (alias usrpri) user user name (from uid) utime accumulated user CPU time vsz virtual size in Kbytes (alias vsize) wchan wait channel (as a symbolic name) xstat exit or stop status (valid only for stopped or zombie process) FILES
/dev special files and device names /dev/drum default swap device /var/run/dev.cdb /dev name database /var/db/kvm.db system namelist database /netbsd default system namelist SEE ALSO
kill(1), pgrep(1), pkill(1), sh(1), w(1), kvm(3), strftime(3), dev_mkdb(8), pstat(8) BUGS
Since ps cannot run faster than the system and is run as any other scheduled process, the information it displays can never be exact. BSD
October 22, 2009 BSD
All times are GMT -4. The time now is 10:02 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy