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!