Home  >  Article  >  Operation and Maintenance  >  What is the linux new file command?

What is the linux new file command?

angryTom
angryTomOriginal
2020-02-28 11:01:2832907browse

What is the linux new file command?

What is the Linux new file command?

The commands that can be used to create files in Linux are: vi/vim, touch, and echo.

Specific usage examples:

(Recommended: Linux video tutorial)

1, vi/vim

vi 1.txt # 会直接创建并打开一个文件1.txt

Note: The file will only be created when you enter: w to save. If you exit directly with: q, the file will not be created.

2. touch

The function of touch is to change the time of a file or directory, and it can also be used to create a file that does not exist.

touch 2.txt # 如果2.txt不存在,则创建空文件2.txt

3. echo

echo is an output command. With the redirection symbol, you can create a file

echo “abcd” > 3.txt # 可以直接创建文件3.txt并将abcd写入。

This article comes from the PHP Chinese website, Linux system tutorial, please continue to pay attention to this column for more related tutorials!

The above is the detailed content of What is the linux new file command?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn