what is the difference between Touch & cat command

Answer Posted / shan, chennai

Cat:-
Using the cat command, we will be able to create the new
file as well as put the required ocntent inside the files
(CNTL+d to come out the file after putting the content). At
a time only one file can create.

Touch:-
Using this command, we can create the more than one file at
a time without inserting the content (So file size will be
always ZERO).

Example:
$cat > test11.js
$touch test1.ls test2.js test3.js

Shan, Chennai

Is This Answer Correct ?    10 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What does the metacharacter mean?

612


What is the use of sed command in unix?

602


Write a command to kill the last background job?

621


Can you enlist some commonly used network commands?

604


Describe the zip/unzip command using gzip.

615






Why is it called a shebang?

574


What is $0 bash?

653


What is grep in bash?

590


Explain ‘library functions’ with respect to unix commands?

605


What do chgrp command do?

594


How does pipe () work?

597


Write a command that will display files in the current directory, in a colored, long format.

689


What does the “echo” command do?

626


Are you in or at the office?

611


What does sed command do in unix?

568