In shell scripting, file descriptors are numbered: 0 for stdin (standard input), 1 for stdout (standard output), and 2 for stderr (standard error). To redirect stderr to a file, you use > followed by the file descriptor number, so 2> means redirect file descriptor 2 (stderr) to a file.