How can I create an empty file from the command line?
Tell me more
×
Ask Ubuntu is a question and answer site for
Ubuntu users and developers. It's 100% free, no registration required.
|
Use the
Example:
|
|||
|
|
Will also create an empty file. If the file does already exist, it will be truncated (emptied). To keep the file contents, use
Even if the file exists, the contents will be untouched. |
|||||||||
|
the exact way there is also another way
The difference is file1.ext will be zero bytes and file2.ext would be one byte. You can check this by
|
|||||
|
|
Using Any Text editor you can also create an empty file.
Then save
|
|||
|
|
