sam71
April 29, 2005, 12:54pm
1
Hi All ,
My colegue using this command and i doesnt understand what it does.
ps -ef | grep pm
pm is may be powermart .
i dont know what is ps and -ef flag does.
If i want to serch for all the directories listed with .parm extention how can i search for all the directory using grep command?
Thanks to All in advance,
sam71
RTM
April 29, 2005, 1:37pm
2
ps -ef
ps - see the man page for ps
ps = report process status
ps -e list info about every process now running
ps -f generate a full listing
So he is checking all processes and then looking for those that have 'pm' in them.
Use the find command, not the grep command - or you can use a ls -Ra and pipe to grep but the find command would be easier.
sam71
April 29, 2005, 1:47pm
3
pm_repo 1307102 843936 0 Apr 26 - 0:54 pmrepagent Config/DW_0DEV-es.cfg 0 usush080 5001 5002
when i run ps -ef | grep pm
command i get above messege line what is this coderepresent 1307102,843936 ,0 ,0.54,pmrepagent ?
can you please tell me RTM that how can i grep the list of directories under the current directory using grep command?
Thanks
sam71
ls -l | grep ^d
gives all direcries under current directory.
man ps for other question.
when i run ps -ef | grep pm
command i get above messege line what is this coderepresent 1307102,843936 ,0 ,0.54,pmrepagent ?
1307102 - Process ID
843936 --- Parent Process ID
0 --- Processor utilization for scheduling
0.54 --- The cumulative execution time for the process.
sam71
April 29, 2005, 6:41pm
5
Thanks very much bhargav. suppose if i use the grep command
and i want to search for all the .parm file and i wanto search under
any directory for example
grep *.parm Input
How can i pass the input as directorires so that it can find the .parm file for all the input as directories.
Thanks
I do n't think grep is suitable command in this context.
Use 'find' command instead.
find $dir -name "*param"
will give all .param files under $dir.
or write a shell script and pass dir as commnad line argument and in hte script
do some thing like this
find $1 -name "*.param"
sam71
May 1, 2005, 3:03pm
7
Hi bhargav,
as you told this command what is -name , and $dir i have to specify directory path or just write $dir.sorry i am begginer so dont know much about it.
find $dir -name "*param"
THanks
sam71
specify dirpath in place of $dir for find command.
or put
dir=/path/of/the/dir
and user $dir as shell variable.
There are lot of unix tutorials in the FAQ area of this web site
to make start ...
sam71
May 2, 2005, 11:49am
9
Thanks it works great for me
Again thanks for your help