Creating New Linux Files from Command Line

Linux is designed to create any file you specify, even if it doesn’t already exist. One smart feature is that you can create a file directly, if you want to create file in terminal you can directly create a file in linux terminal using this command

1. Create a File with Touch Command

touch test1.txt

2. Create a New File With the Redirect Operator

> test2.txt

3. Create File with cat Command

cat > test3.txt

4. Create File with echo Command

echo ‘this is sample file’ > test4.txt

5. Create a File using vi text editor

vi test5.txt

6. Create a file using vim text editor

vim test6.txt

7. Create a file using nano text editor

nano test7.txt

8. Create a file using tee command

command | tee test8.txt

thanks for reading…………………………………….|