- FIND. Allows you to search for text within a file. Although MS-DOS itself is not case sensitive, when typing in the string that you are looking for with the find command, it is case sensitive.
Additionally, this command is used to find text within a file, not the actual file itself. If you are wanting to search or find a file with a particular name, use the dir command. There are some parameters, /V to displays all lines NOT containing the specified string, /C to displays only the count of lines containing the string, /N to displays line numbers with the displayed lines, and /I to ignores the case of characters when searching for the string.
For example:
find /c "REM" c:\autoexec.bat, The above example would find any "REM" statement in the autoexec.bat. or:
find "mate" *.txt, Next this example searches for any text file (.txt) that contains the text hope in the current directory. Below is an example of the output you may see
- FINDSTR. The findstr command is short for find string and is a command used in MS-DOS to locate files containing a specific string of plain text. There are so many parameters that you can use, it’s better to improve yourself to try on it one by one, makes you smarter :). However, I will give some example how to use this command
findstr "computer mate" myfile.txt
In the above example, any lines containing "computer mate" would be printed to the screen.
findstr /s "computer mate" *.txt
Similar to the first example, the above example would find any lines containing "computer mate" in any txt file in the current directory and all sub directories
findstr /x /c:"computer mate" *.txt
Match .txt files that contain an exact match on "computer mate"; therefore, files that contain "computer mates" or other non-exact matches will not be displayed. It is important to realize that using /x must be a line that exactly matches "computer mate"; in other words, if anything else is on the same line, it's not an exact match.
findstr /n /i /c:"computer mate" *
Search for any file containing "computer mate" regardless of its case and display the line where the text is found.
- FORMAT. This command use to re-format or erase all information in disk. I will just explain the format recovery disk in CMD, since doing format with click in windows explorer is more easy and get the same result, everyone prefer to use click than type :p.
format a:
Would erase all the contents off a disk. Commonly used on a diskette that has not been formatted or on a diskette you wish to erase.
format a: /q
Quickly erases all the contents of a floppy diskette. Commonly used to quickly erase all information on the diskette.
format c:
This would erase all the contents of your C: hard disk drive. In other words, unless you wish to erase all your computer's information, this command should not be done unless you're planning to start over.
- FTYPE. This command use equal with ASSOC. If assoc is showing what extension does that mean, FTYPE use to modified it. This was a little hard for me to understand :p.
0 comments:
Post a Comment