Sponsored Content
Top Forums Programming Print ancestor list in c (name and PID) Post 302567647 by Corona688 on Monday 24th of October 2011 03:26:58 PM
Old 10-24-2011
The output of ps is highly system-dependent, and there's probably better ways to get the information depending on your system. What is your system?
 

10 More Discussions You Might Find Interesting

1. Programming

printing ppid,child pid,pid

question: for the below program i just printed the value for pid, child pid and parent pid why does it give me 6 values? i assume ppid is 28086 but can't figure out why there are 5 values printed instead of just two! can someone comment on that! #include<stdio.h> #define DIM 8 int... (3 Replies)
Discussion started by: a25khan
3 Replies

2. UNIX for Dummies Questions & Answers

Session PID & socket connection pid

1. If I use an software application(which connects to the database in the server) in my local pc, how many PID should be registered? Would there be PID for the session and another PID for socket connection? 2. I noticed (through netstat) that when I logged in using the my software application,... (1 Reply)
Discussion started by: pcx26
1 Replies

3. Shell Programming and Scripting

How to print a directory list to a file?

I have directory of files listed with stats. I need to print only files with the same stats to a file. I tried this, and it printed a blank document. *1556 > tmp/list it did not work any suggestions? (3 Replies)
Discussion started by: rocinante
3 Replies

4. UNIX for Dummies Questions & Answers

Need to get pid of a process and have to store the pid in a variable

Hi, I need to get the pid of a process and have to store the pid in a variable and i want to use this value(pid) of the variable for some process. Please can anyone tell me how to get the pid of a process and store it in a variable. please help me on this. Thanks in advance, Amudha (7 Replies)
Discussion started by: samudha
7 Replies

5. Shell Programming and Scripting

list of all predecessors and successors for given PID

Dear experts, I'm moving from SunOS to Linux. Linux has no ptree, but it has pstree. Anyway, pstree doesn't show what ptree used to print with output nice to grep. My Linux distribution doesn't have proctree either. This forum has few posts touching ptree/pstree topic, but I didn't... (2 Replies)
Discussion started by: bzk
2 Replies

6. Shell Programming and Scripting

Unix Script -- Suggestions to list and kill PID's sequentially

Hi, I'm trying to write a script where i'm trying to grep the PID and the associated file and list them. Then execute the KILL command sequentially on the listed PID's for ".tra" files ==================================================== ps -aux | grep mine adm 27739 0.2 0.8 1131588... (12 Replies)
Discussion started by: murali1687
12 Replies

7. Shell Programming and Scripting

Print list to row using awk

Hello, can somebody help me on this please. I have a list of numbers and I want to print them in one line seprated by a comma except the last one using awk 34 12 56 76 88 output 34,12,56,76,88 Thanks Sara (15 Replies)
Discussion started by: Sara_84
15 Replies

8. Shell Programming and Scripting

Portable way to print list in columns

so if i have a list of file names, on linux system, we can use the column command to split them up into columns. sadly, the "columns" command does not exist on some OSes. so i found that the pr command can also work. but, pr tends to truncate the names. There's a way around that on... (3 Replies)
Discussion started by: SkySmart
3 Replies

9. AIX

UNIX ksh - To print the PID number and repeat count

This question is asked in an interview today that I have to return output with each PID number and the count of each PID number logged today. Here is the script that I have written. Can you confirm if that would work or not. The interviewer didn't said if my answer is correct or not. Can someone... (5 Replies)
Discussion started by: Subodh Kumar
5 Replies

10. Shell Programming and Scripting

How to list all outbound sockets given a PID?

I used netstat -tp <pid> to list all Foreign Addresses i.e OutBound sockets on Linux. Likewise, i wish to list all Foreign Addresses on Sparc Solaris. I get illegal option -- t when i try this command on Solaris. The second query i have is that in the output of netstat command some... (1 Reply)
Discussion started by: mohtashims
1 Replies
prtconf(1M)															       prtconf(1M)

NAME
prtconf - print system configuration SYNOPSIS
/usr/sbin/prtconf [-V] | [-F] | [-x] | [-bpv] | [-acDPv] [dev_path] The prtconf command prints the system configuration information. The output includes the total amount of memory, and the configuration of system peripherals formatted as a device tree. If a device path is specified on the command line for those command options that can take a device path, prtconf will only display informa- tion for that device node. The following options are supported: -a Display all the ancestors device nodes, up to the root node of the device tree, for the device specified on the command line. -b Display the firmware device tree root properties for the purpose of platform identification. These properties are "name", "compat- ible", "banner-name" and "model". -c Display the device subtree rooted at the device node specified on the command line, that is, display all the children of the device node specified on the command line. -D For each system peripheral in the device tree, displays the name of the device driver used to manage the peripheral. -F Returns the device path name of the console frame buffer, if one exists. If there is no frame buffer, prtconf returns a non-zero exit code. This flag must be used by itself. It returns only the name of the console, frame buffer device or a non-zero exit code. For example, if the console frame buffer on a SUNW,Ultra-30 is ffb, the command returns: /SUNW,ffb@1e,0:ffb0. This option could be used to create a symlink for /dev/fb to the actual console device. -p Displays information derived from the device tree provided by the firmware (PROM) on SPARC platforms or the booting system on platforms.The device tree information displayed using this option is a snapshot of the initial configuration and may not accu- rately reflect reconfiguration events that occur later. -P Includes information about pseudo devices. By default, information regarding pseudo devices is omitted. -v Specifies verbose mode. -V Displays platform-dependent PROM (on SPARC platforms) or booting system (on platforms) version information. This flag must be used by itself. The output is a string. The format of the string is arbitrary and platform-dependent. -x Reports if the firmware on this system is 64-bit ready. Some existing platforms may need a firmware upgrade in order to run the 64-bit kernel. If the operation is not applicable to this platform or the firmware is already 64-bit ready, it exits silently with a return code of zero. If the operation is applicable to this platform and the firmware is not 64-bit ready, it displays a descriptive message on the standard output and exits with a non-zero return code. The hardware platform documentation contains more information about the platforms that may need a firmware upgrade in order to run the 64-bit kernel. This flag overrides all other flags and must be used by itself. The following operands are supported: dev_path The path to a target device minor node, device nexus node, or device link for which device node configuration information is displayed The following exit values are returned: 0 No error occurred. non-zero With the -F option (SPARC only), a non-zero return value means that the output device is not a frame buffer. With the -x option, a non-zero return value means that the firmware is not 64-bit ready. In all other cases, a non-zero return value means that an error occurred. See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWesu | +-----------------------------+-----------------------------+ |Interface Stability |Unstable | +-----------------------------+-----------------------------+ fuser(1M), modinfo(1M), sysdef(1M), attributes(5) Sun Hardware Platform Guide SPARC Only openprom(7D) The output of the prtconf command is highly dependent on the version of the PROM installed in the system. The output will be affected in potentially all circumstances. The driver not attached message means that no driver is currently attached to that instance of the device. In general, drivers are loaded and installed (and attached to hardware instances) on demand, and when needed, and may be uninstalled and unloaded when the device is not in use. On platforms, the use of prtconf -vp provides a subset of information from prtconf -v. The value of integer properties from prtconf -vp might require byte swapping for correct interpretation. 9 Aug 2005 prtconf(1M)
All times are GMT -4. The time now is 11:13 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy