Programming Field

‘<’ (Input redirection) - DOS/Command Prompt Reference

Passes content of the file, specified on the right side of this symbol, as an input to the command, specified on the left side.

Syntax

<command> < <file-name>

Details

Usage of ‘<’

By using input redirection, you can supply input data from a file to the command which usually receive input from standard input. Input redirection has a role to change standard input source to specified file (instead of console).

Samples

Sample 1

sort < document.txt

Sorts and outputs each line of text written in ‘document.txt’ by using Sort command.