command > file.txt

Category: I/O Redirection & Pipes

command > file.txt

Redirect stdout to a file (overwrite)

Saves a command's output to a file, overwriting any existing content. > is the redirect-to-file operator.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.