In the command sort < names.txt, the shell connects names.txt to the command's standard input, which is file descriptor…