O'Reilly logo

Linux Pocket Guide, 2nd Edition by Daniel J. Barrett

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating a File Quickly

You can quickly create an empty file (for later editing) using the touch command:

$ touch newfile

or the echo -n command (see File Properties):[9]

$ echo -n > newfile2

or write data into a new file by redirecting the output of a program (see Input/output redirection):

$ echo anything at all > newfile

[9] The -n option prevents a newline character from being written to the file, making it truly empty.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required