By default commands will expect their input to come from the keyboard and they will print their output to the screen. Sometimes, you want to save the output in a file. In Linux language it is said that you want to redirect the output.
For output redirection you can use the >
symbol, e.g.ls -al > NewFile.txt
will redirect the listing of files and folders to a text file instead of your screen.
!Redirecting is not without risk: if you redirect the output to an existing file, the content of that file will be deleted and the file will be overwritten!
If you don’t want the file to be overwritten, you can simply add the output to the file, by using >>
like here: ls -al >> ExistingFile.txt
Practice a bit more on your own computer:
Open Replit, go to Recipies, and create a Menu consisting of soup, mussels and our favorite dessert.