Sponsored Content
Top Forums UNIX for Dummies Questions & Answers [Solved] How to remove listing of current user cmd from ps -ef listing? Post 302766917 by KDMishra on Tuesday 5th of February 2013 11:47:49 PM
Old 02-06-2013
[Solved] How to remove listing of current user cmd from ps -ef listing?

Hi All,


Could you please help to resolve my following issues:

Problem Description:

Suppose my user name is "MI90".
i.e. $USER = MI90

when i run below command, i get all the processes running on the system containing name MQ.

ps -ef | grep MQ

But sometimes it lists "grep MQ" cmd also in its output, which is nothing but the above cmd which i executed to check all the running processes of system.
& sometimes not.

NEED:

My need is that it should always avoid listing "grep MQ", which has been started just now by the current user i.e. MI90

Examples:

when i run $ ps -ef | gre MQ

i got :

MI90 36241614 36110452 0 05:41:31 pts/2 0:00 grep MQ
tibco 38535330 1 0 02:05:18 - 0:11 /appl/tibco/adapter/admqs/6 .2/bin/admqs --pid --run --propFile /appl/tibco/tra/domain/PR/application/MQAdap ter/MQAdapter-ABNAMROMQAdapter.tra --innerProcess
tibco 38797444 1 1 02:05:18 - 0:11 /appl/tibco/adapter/admqs/6 .2/bin/admqs --pid --run --propFile /appl/tibco/tra/domain/PR/application/MQAdap terNew/MQAdapterNew-ABNAMROMQAdapterNew.tra --innerProcess


but i always need only below:

tibco 38535330 1 0 02:05:18 - 0:11 /appl/tibco/adapter/admqs/6 .2/bin/admqs --pid --run --propFile /appl/tibco/tra/domain/PR/application/MQAdap ter/MQAdapter-ABNAMROMQAdapter.tra --innerProcess
tibco 38797444 1 1 02:05:18 - 0:11 /appl/tibco/adapter/admqs/6 .2/bin/admqs --pid --run --propFile /appl/tibco/tra/domain/PR/application/MQAdap terNew/MQAdapterNew-ABNAMROMQAdapterNew.tra --innerProcess


So please help me in getting such o/p....

Thanks in advance!
Regards,
KD
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Recursive directory listing without listing files

Does any one know how to get a recursive directory listing in long format (showing owner, group, permission etc) without listing the files contained in the directories. The following command also shows the files but I only want to see the directories. ls -lrtR * (4 Replies)
Discussion started by: psingh
4 Replies

2. UNIX for Dummies Questions & Answers

Find files older than 5 days and remove tem after listing

need help with this ... Find files older than 5 days and remove tem after listing list "test" file older than 5 days and then remove them (1 Reply)
Discussion started by: ypatel6871
1 Replies

3. Shell Programming and Scripting

listing files that do not belong to current date

How do we list all the file names in a directory that does not belong to current date. (1 Reply)
Discussion started by: esh.mohan
1 Replies

4. UNIX for Dummies Questions & Answers

listing files that does not belong to current date

How do we list all the file names in a directory that does not belong to current date. (3 Replies)
Discussion started by: esh.mohan
3 Replies

5. UNIX for Dummies Questions & Answers

Listing only directories in the current working directory using the "ls" command

Hello All, I am trying to list only directories in my current directory using the command "ls -d". But the output only contains the default directory "." and doesn't list the rest of the directories in the working directory. Can anyone explain why this is happening (2 Replies)
Discussion started by: igandu
2 Replies

6. UNIX for Dummies Questions & Answers

listing home dir of anothe user

Hi I am trying to display the home directory of another user. I dont have the permissions to change into their directory and wonder is it possible to display their directory eg I cant change directory to john but I am trying to display something like /home/John. If anyone can help I would... (3 Replies)
Discussion started by: mmg2711
3 Replies

7. UNIX for Dummies Questions & Answers

[Solved] Problem with listing my files

Hello, In my directory i have got a list of files like below unix1a.csv unix1b.csv unix1c.csv unix1d.csv unix1y.csv I have done ls -lrt unix1.csv, how can i get my unix1y.csv also get listed along with this.. (5 Replies)
Discussion started by: sathyaonnuix
5 Replies

8. UNIX for Dummies Questions & Answers

Listing based on User and Date

listing based on user. I have files in some folder that come from many user -rwxrwxr-x 1 ratih pbank 4827112 Jun 8 08:37 S92TA-8.sgy -rwxrwxr-x 1 ratih pbank 4724568 Jun 8 08:37 S92TA-6.sgy -rwxrwxr-x 1 ratih pbank 4929656 Jun 8 08:37 S92TA-19.sgy -rwxrwxr-x 1 ratih ... (4 Replies)
Discussion started by: muhnandap
4 Replies

9. UNIX for Dummies Questions & Answers

[Solved] Listing files starting with p or f and with the exact length of 3 characters

Hello, I need some help. How can I list files starting with p or f and with the exact length of 3 characters? (2 Replies)
Discussion started by: airbebe
2 Replies

10. Shell Programming and Scripting

Listing multiple files in windows cmd

i have multiple files like how to do list files from new_30 to new_50 i have tried this command but it wont work dir new*{30-50}.txt my exact requirement is to get line count of these files the command which work is FOR %i IN (new*.txt) DO find %i /c /v "" but at the... (1 Reply)
Discussion started by: sagar_1986
1 Replies
CPUSET(1)						    BSD General Commands Manual 						 CPUSET(1)

NAME
cpuset -- configure processor sets SYNOPSIS
cpuset [-l cpu-list] [-s setid] cmd ... cpuset [-l cpu-list] [-s setid] -p pid cpuset [-c] [-l cpu-list] -C -p pid cpuset [-c] [-l cpu-list] [-j jailid | -p pid | -t tid | -s setid | -x irq] cpuset -g [-cir] [-d domain | j jailid | -p pid | -t tid | -s setid | -x irq] DESCRIPTION
The cpuset command can be used to assign processor sets to processes, run commands constrained to a given set or list of processors, and query information about processor binding, sets, and available processors in the system. cpuset requires a target to modify or query. The target may be specified as a command, process id, thread id, a cpuset id, an irq, a jail id, or a NUMA domain. Using -g the target's set id or mask may be queried. Using -l or -s the target's CPU mask or set id may be set. If no target is specified, cpuset operates on itself. Not all combinations of operations and targets are supported. For example, you may not set the id of an existing set or query and launch a command at the same time. There are two sets applicable to each process and one private mask per thread. Every process in the system belongs to a cpuset. By default processes are started in set 1. The mask or id may be queried using -c. Each thread also has a private mask of CPUs it is allowed to run on that must be a subset of the assigned set. And finally, there is a root set, numbered 0, that is immutable. This last set is the list of all possible CPUs in the system and is queried using -r. When running a command it may join a set specified with -s otherwise a new set is created. In addition, a mask for the command may be speci- fied using -l. When used in conjunction with -c the mask modifies the supplied or created set rather than the private mask for the thread. The options are as follows: -C Create a new cpuset and assign the target process to that set. -c The requested operation should reference the cpuset available via the target specifier. -d domain Specifies a NUMA domain id as the target of the operation. -g Causes cpuset to print either a list of valid CPUs or, using -i, the id of the target. -i When used with the -g option print the id rather than the valid mask of the target. -j jailid Specifies a jail id as the target of the operation. -l cpu-list Specifies a list of CPUs to apply to a target. Specification may include numbers separated by '-' for ranges and commas sepa- rating individual numbers. A special list of ``all'' may be specified in which case the list includes all CPUs from the root set. -p pid Specifies a pid as the target of the operation. -s setid Specifies a set id as the target of the operation. -r The requested operation should reference the root set available via the target specifier. -t tid Specifies a thread id as the target of the operation. -x irq Specifies an irq as the target of the operation. EXIT STATUS
The cpuset utility exits 0 on success, and >0 if an error occurs. EXAMPLES
Create a new group with CPUs 0-4 inclusive and run /bin/sh on it: cpuset -c -l 0-4 /bin/sh Query the mask of CPUs the <sh pid> is allowed to run on: cpuset -g -p <sh pid> Restrict /bin/sh to run on CPUs 0 and 2 while its group is still allowed to run on CPUs 0-4: cpuset -l 0,2 -p <sh pid> Modify the cpuset /bin/sh belongs to restricting it to CPUs 0 and 2: cpuset -l 0,2 -c -p <sh pid> Modify the cpuset all threads are in by default to contain only the first 4 CPUs, leaving the rest idle: cpuset -l 0-3 -s 1 Print the id of the cpuset /bin/sh is in: cpuset -g -i -p <sh pid> Move the pid into the specified cpuset setid so it may be managed with other pids in that set: cpuset -s <setid> -p <pid> Create a new cpuset that is restricted to CPUs 0 and 2 and move pid into the new set: cpuset -C -c -l 0,2 -p <pid> SEE ALSO
cpuset(2) HISTORY
The cpuset command first appeared in FreeBSD 7.1. AUTHORS
Jeffrey Roberson <jeff@FreeBSD.org> BSD
January 8, 2015 BSD
All times are GMT -4. The time now is 06:52 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy