NLM logo

> (greater-than)

This documentation reflects EDirect version 10.9, released on 2/1/2019.

We strive to keep this documentation up-to-date with the latest release. If you are looking for documentation on a more recent version of EDirect, or to find out more about new EDirect releases, please see the Release Notes of NCBI's EDirect documentation.

The Unix redirection operator “>” can be used to redirect the output of a command to a file. Simply add “>” at the end of the command, followed by the name of the file to which you wish to redirect the output. The file will be saved in your Unix working directory.


Redirect the output of an efetch command to a file named “abstract.txt”:

efetch -db pubmed -id 26287646 -format abstract > abstract.txt

Redirect the output of an esearch command to a file named “search_results.xml”:

esearch -db pubmed -query "h1n1 asthma" > search_results.xml