Quick Answer: Which Linux Command Can Be Used to Create a Blank File in the Current Directory?
Contents

How do you create a blank file in Linux?

Use the Command Line to Create a New Blank Text Document in Linux.

To use the command line to create a new, blank text file, press Ctrl + Alt + T to open a Terminal window.

Type the following command and press Enter.

How do you create a new file in Linux?

Part 2 Creating a Quick Text File

  • Type cat > filename.txt into Terminal. You’ll replace “filename” with your preferred text file name (e.g., “sample”).
  • Press ↵ Enter .
  • Enter your document’s text.
  • Press Ctrl + Z .
  • Type ls -l filename.txt into Terminal.
  • Press ↵ Enter .
Robert Thorne

Robert Thorne

Automotive & Future Transportation Editor

Robert Thorne covers electric vehicle innovations, autonomous driving systems, global mobility trends, and automotive engineering developments.

Share this article
Twitter Facebook Pinterest