How to create list file in unix
- how to create file in unix
- how to create file in unix shell script
- how to create file in unix using cat
- makefile unix
How to create a file in unix using cat!
How to Create a File in the Linux Using the Terminal?
In this article, we will learn to create a file in the Linux/Unix system using the terminal.
How to create a file in linux command
In the Linux/Unix system, there are the following ways available to creating files.
- Using the touch command
- Using the cat command
- Using redirection operator
- Using the echo command
- Using the heredoc
- Using the dd command
1.
Create a file in the Linux/Unix system using the touch command.
The touch command is used to create file/files without any content and update the access date or modification date of a file or directory in the Linux system.
This is the simplest way to create a file in Linux/Unix using the terminal.
Syntax:
The general syntax of the touch command is as follows:
$ touch [option] ... FILE...A brief description of options available in the touch command.
| Option | Description |
|---|---|
| -a | Change the access time of a file |
| -c, –no-create | Check file is available or not, if not available then prevent creating a file |
| -f | ignored |
| -m | Change the modification time of a file |