December 2018
Beginner
320 pages
8h 57m
English
We can also create a text file using the redirection symbol (>), which is used to redirect the output of a command to a file. If we use the redirection symbol alone without prefixing it with any command, then it will create an empty file of 0 bytes and remove the file's content if a file already exists with the given name, as shown in the following command line:
$ > demo.txt
If we prefix the redirection symbol (>) with any command, then it creates a new file, which contains the output of the command preceding the redirection symbol, as shown in the following screenshot:

We can create one ...
Read now
Unlock full access