we can create a file in 3 different ways.
1) Touch Command :-
syntax:- touch <filename>
lets assume you want to create file called linuxtechnotes.
# touch linuxtechnotes
using below command we can create multiple files in single command. lets assume you want to create files called linux1,linux2,linux3.
#touch linux1 linux2 linux3
2) vi :-
using 'vi' command we can edit the existing files and create the new file as well.
syntax:- vi <filename>
In below example created a file called file1 with context.
syntax :- echo "context" > <filename>
In below example created a file called file2 with context .
Note :- using any of touch,vi,echo we are able to create a file . But did you notice any difference ?
The difference is using 'touch' command we can create a file without any context . But to create using " 'vi'and 'echo' we need context aswell and also we can create both file and context during same time .
Post a Comment