Computing.Net > Forums > Disk Operating System > how do you do a search in DOS?

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

how do you do a search in DOS?

Reply to Message Icon

Name: harris
Date: June 1, 2002 at 15:37:05 Pacific
Comment:

I know you can 'find' text strings in txt files with the find and findstr commands but what i want to know is how do you find files on your computer in DOS? For example, if i wanted to do a search all my *.exe files in DOS, how would I do that?



Sponsored Link
Ads by Google

Response Number 1
Name: Dan Penny
Date: June 1, 2002 at 16:00:44 Pacific
Reply:

dir/s/p *.exe

The /s searches all sub-directories, the /p gives you a pause between each screen. If you have more than one hard drive, just change to the drive you want to search. (ie; d:(enter)


0

Response Number 2
Name: Secret_Doom
Date: June 1, 2002 at 17:38:55 Pacific
Reply:

That command Dan posted will search for all the files with EXE extention on the current directory and in all subdirectories under it. So, it will only search the entire drive if the current directory is the root. To search the entire drive, regardless of what is the current directory, do this:

dir/s/p \*.exe
-- or --
dir/s/p/b \*.exe

The /b switch will only display the files (with full path, because of /s), no additional lines.

Type DIR/? for more information.

-- Secret_Doom - Leonardo Pignataro --

secret_doom@hotmail.com
www.batch.hpg.com.br


0

Response Number 3
Name: Dan Penny
Date: June 1, 2002 at 17:55:48 Pacific
Reply:

Quite right Secret_Doom. I neglected to state that you should be in the root of a drive for the command to work under ALL directories. (I took it for granted as that's what I always do to search a hard drive. ie; cd\, then the command.) Thanks. Personal habit precluded a clear statement.


0

Response Number 4
Name: Wengier
Date: June 1, 2002 at 19:59:01 Pacific
Reply:

Or: DIR \.EXE/A/S/P


0

Response Number 5
Name: Secret_Doom
Date: June 1, 2002 at 21:24:06 Pacific
Reply:

No problem, Dan ! =D

-- Secret_Doom - Leonardo Pignataro --

secret_doom@hotmail.com
www.batch.hpg.com.br


0

Related Posts

See More



Response Number 6
Name: W0rm
Date: June 2, 2002 at 14:07:18 Pacific
Reply:

I find the fastest way to do it is to use ATTRIB:

ATTRIB *.EXE /S
- W0rm
- http://dos.li5.org


0

Response Number 7
Name: fredc
Date: June 2, 2002 at 14:37:43 Pacific
Reply:

use find

dir /s \. |find "text"
will find any occurrence of text in any filename


0

Response Number 8
Name: harris
Date: June 2, 2002 at 21:30:44 Pacific
Reply:

thanks to all u l33t peepz, u've alll been very helpful! peace~~harris


0

Response Number 9
Name: fred6008
Date: June 13, 2002 at 23:26:12 Pacific
Reply:

You will usually only want one file. (What directory is Ramdrive.Sys in, etc.) It is just DIR /S and the file name. DIR /S RAMDRIVE.SYS in this case. DIR will search the whole drive--when you start at the root--and tell you by printing to the screen the directories RAMDRIVE.SYS was in if any.


0

Response Number 10
Name: Electron2623
Date: July 22, 2002 at 18:22:37 Pacific
Reply:

well....
this is how you do it !!!
find / -name "[name of file]" -print | more


0

Response Number 11
Name: Peter
Date: July 31, 2002 at 08:48:38 Pacific
Reply:

Not a suggestion on how this is best done, rather a further question based around this:

How would one pipe the contents of each of the files found to a file, appending them contiguously?

p.s. incidentally I found the attrib suggestion was very quick.


0

Sponsored Link
Ads by Google
Reply to Message Icon

Command differences in DO... subst.exe



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Disk Operating System Forum Home


Sponsored links

Ads by Google


Results for: how do you do a search in DOS?

HELP!....removing a file in dos www.computing.net/answers/dos/helpremoving-a-file-in-dos-/3028.html

how do you? www.computing.net/answers/dos/how-do-you/4228.html

How can I close a program in dos? www.computing.net/answers/dos/how-can-i-close-a-program-in-dos/13404.html