Intermediate shell commands
In the previous section, we used some basic commands in order to get used to Terminal. In this section, we will get familiar with more advanced commands, as follows:
echocommand allows you to display content that can be added to either a new or an existing file or to replace the content.
- If you want to add content to an existing file, you can use
echo "content to be appended" >>file1.txt. Or, you can use
echo "this content will replace" > file1.txtto replace the content of a file.
You can see the
echo command in use here:
Figure 2.6 – echo command
Figure 2.7 – cat command