>step 1 of 7
Save what a command prints
You’ve used > with echo. It works with any command: whatever would have appeared on screen goes into the file instead.
$ ls data > data/contents.txtNow data/contents.txt holds the list of files. Commands that print things to the screen can always save them like this.
Your turn, in the terminal
- Save the list of files in data into data/contents.txt