You can create multiple files at once using the touch
command in Linux by specifying the names of the files you want to create separated by a space. Here's an example:
To create three new empty files called file1.txt
, file2.txt
, and file3.txt
in a single command, you can use the following syntax:
bashtouch file1.txt file2.txt file3.txt
This command will create all three files in the current directory. If you want to create the files in a specific directory, you can specify the directory path before the filenames. For example, if you want to create the files in the /home/user/documents
directory, you can use the following command:
bashtouch /home/user/documents/file1.txt /home/user/documents/file2.txt /home/user/documents/file3.txt
This command will create the three files in the documents
directory of the user
account's home directory.
Comments
Post a Comment