cancel
Showing results for 
Search instead for 
Did you mean: 

Some basic windows questions

Former Member
0 Kudos

I am sorry to ask these but hope somebody can help.

1) what is the equavelent of "| grep" ( i.e. pipe and grep in UNIX)

2) how to direct the output on a cmd to a file? In UNIX, it is "script file-name" before the output.

Please help. Thanks a lot!

Accepted Solutions (1)

Accepted Solutions (1)

anindya_bose
Active Contributor
0 Kudos

Hi Linda

Instead of grep use CTRL+F to search in windows.

to redirect out put of file.bat to file2.txt type the following in command prompt of windows

>file.bat >file2.txt

Use "help" in command prompt to know about windows command

Former Member
0 Kudos

Mr.Bose:

Thanks!

However, I am issuing the command

"netstat -abon" and the output is too long. That's why I want

netstat -abon|grep 6001 (to find the string "6001".

Please help then I close this thread. Regards!

Former Member
0 Kudos

Hello,

You have run "tasklist" to get the process list.On your command prompt try these:

1)tasklist | grep <process_name>

For outputting them to text files, please check these commands.

2) tasklist > D:\ test.txt

3)tasklist | grep <process name> > D:\"file".txt

thanks,Prasanna

Edited by: Prasanna K on Jun 26, 2009 6:10 PM

anindya_bose
Active Contributor
0 Kudos

Hi Linda

use

>netstat -abon >out.txt

This will redirect the out put of netstat -abon to out.txt file. out.txt file will be created where you invoke the commad prompt from, generally "C:\Documents and Settings\Administrator". Then you can search in that file any string like '6001'

Hope this answers your question.

Thanks and Regards

Anindya

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Linda,

Regrading your grep question you can use the find command

more file.txt | find "text"

Regards,

Bill