How do you create a file in UNIX

Answer Posted / suchitra

cat > filename
this will create a file adn allows you to enter text and
to come out of the file,press ctrl+d.Then teh file will be
created.

touch command can also be used to create file.but this will
create empty file.

using Vi editor also the files can be created.

and few more editor like "ed" can also be used.
hence there are many ways to create a file in unix.

Is This Answer Correct ?    97 Yes 20 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between cat and more command?

625


Which unix command lists files/folders in alphabetical order?

617


Explain ‘system calls’ with respect to unix commands?

600


What is the use of tee command?

569


What does the metacharacter mean?

608






How can you see the command line history?

584


What is merge command in unix?

942


Explain ‘library functions’ with respect to unix commands?

604


Enumerate some of the most commonly used network commands in unix?

616


Is there a way to erase all files in the current directory, including all its sub-directories, using only one command?

798


Who invented grep?

651


Is command prompt unix?

582


What does this command do? Cat food 1 > kitty

976


What is pipe command in unix?

670


What does the “echo” command do?

624