Using Redirection to Create Files in Linux
Before we look at how you delete files and copy them, we should prepare some files to play with.
It’s possible to send the results from a command to a file instead of the screen; in other words, to redirect them. You could keep some listing results in a file, for example, so you have a permanent record of them or so you can analyze them using a text editor. You turn screen output into a file by using a greater-than sign and the filename you’d like to send the output to, like this:
ls > listing.txt
If you want a bit of variety, you can use some other commands to display content on screen:
echo: This displays whatever you write after it on screen. You can use it to solve ...