1.

Solve : finding a file in dos...?

Answer»

ok i now about the find command, but everytime i try

find "*.ini"

it just sits there thinking...

am i doing this improperly?

i just want to be able to search for a file on a disk while using dos

thanks guys!Depends on whether you want to find a specific file or all files with the same extension:

At the c:> prompt type dir/s yourfilename.ext lists every file by that name and extension and its location. dir/s *.ext finds all files with that extension and their locations. It does not show hidden and system files normally unless the attributes h and s have been removed. Under DOS this can sometimes a long time as it will look through the entire drive.That's not what find does.

Find searches for a text string in a file or files.

You want the dir command.

Try typing dir *.ini

To discover what any command does, type the command followed by a space and then /?

for example...

dir /?

find /?

Quote

C:\>find /?
Searches for a text string in a file or files.

FIND [/V] [/C] [/N] [/I] [/OFF[LINE]] "string" [[drive:][path]FILENAME[ ...]]

/V Displays all lines NOT containing the specified string.
/C Displays only the count of lines containing the string.
/N Displays line numbers with the displayed lines.
/I Ignores the case of characters when searching for the string.
/OFF[LINE] Do not skip files with offline attribute set.
"string" Specifies the text string to find.
[drive:][path]filename
Specifies a file or files to search.

If a path is not specified, FIND searches the text typed at the prompt
or PIPED from another command.




To search your entire C: drive, including hidden and system files, and recursing hidden directories for *.ini files try
Code: [Select]dir C:\*.ini /a /s /b
/a = all attributes (including hidden and system)
/s = recurse subdirectories
/b = bare format, just list the file name and path without the size, timestamps, etc.Quote from: jeepsterxj on September 04, 2007, 02:02:41 PM

...
i just want to be able to search for a file on a disk while using dos




If you wish to accomplish this using only that which comes with your os, the above comments regarding the dir command are excellent.

To offer another option - the ONE I happen to like - would be a utility program. I keep a copy in a 'utilites' directory, which is in the path.

Fast File Finder.
un-crippled shareware.
You can download a copy here:
http://www.pcworld.com/downloads/file/fid,3771-order,1-page,1-c,alldownloads/description.html

The short description is:
"FileFinder v5.2 - Finds Files, & DIRS
on normal, networked,& CDROM drives & inside
compressed files, also locates DUP files..
Extremely fast and versatile. NEW - ABILITY
to modify file attributes and stop search
after user specifed number of matches. "


It works for me. and it is fast. It offers quite a few command line options, and also after it finds your files, presents you with several options.
You'd have to try it to see if you like it.
If nothing else - the price is right.


.awesome, very nice, i really appreciate the help guys, im trying to learn dos/bash/C++ right now at the same time... and things get a little confusing, so many commands! haha

thanks for the other search tool you gave me as well, im always a fan of trying new soft's

as for now, i think the "dir" command was what i was looking for...


Discussion

No Comment Found