Skip to main content

  | मौसम…

411 समाचार
Public archive edition · Attributed source reporting with original dates · AI drafts are excluded

411 REFERENCE · Wikibooks

Windows Batch Scripting/File Commands

Reference material by Wikibooks contributors. This retains its source identity and is not 411 news reporting.

3. File Commands This chapter covers the following commands: COMP - Compares the contents of two files or sets of files. FC - Compares two files or sets of files, and displays the differences between them. FIND - Searches for a text string in a file or files. FINDSTR - Searches for strings in files. MORE - Displays output one screen at a time. PRINT - Prints a text file. SORT - Sorts input. TYPE - Displays the contents of a text file. The TYPE Command The TYPE command display the contents of a file. There are no options for the TYPE command. C:\>TYPE README.TXT This is a table of contents for "Editing Guide to Windows Commands" File and Directory Management File Commands C:\> The SORT Command The SORT command will sort lines of text from a file. Orange Banana Apple Pear Strawberry Bluberry Blackberry -------- File: fruits.txt C:\>sort fruits.txt Apple Banana Blackberry Bluberry Orange Pear Strawberry C:\> The /R option will sort in reverse order. C:\>sort /R fruits.txt Strawberry Pear Orange Bluberry Blackberry Banana Apple C:\> The MORE Command The MORE command will display output or contents of file a screenful at a time. It is especially useful when piping it with certain commands (such as DIR or TASKLIST) that produce very long output. For example: C:\>tasklist | more