Creating New Linux Files from Command Line

hidepatidar
Jul 17, 2021

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…………………………………….|

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

No responses yet

Write a response