what is the difference between Touch & cat command

Answer Posted / sricharan

touch:
It can be used to create 0 byte empty file.
syntax: touch filename.txt
we can create multiple file using touch command.
syntax: touch file1.txt file2.txt file3.txt ..... filen.txt
touch commnad is also used to update time stamp
Syntax:touch filename

cat:
It can be use to view the file.
Syntax:cat filename
It can be use to append the existing file.
syntax: cat >> filename
It can be use to concatinate n number of files to one file.
syntax: cat file1 file2 file3 file4 >> newfile
cat is also used to create a file
syntax: cat filename

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Differentiate cmp command from diff command.

576


What is the behavioural difference between cmp and diff commands?

660


What are some command words?

547


Describe the zip/unzip command using gzip.

594


What are bash commands?

577






Why is it called grep?

547


What is unix command?

571


How do you grep recursively?

545


Why is awk called awk?

569


Explain the terms ‘system calls’ and ‘library functions’ with respect to unix commands?

622


What is ‘ps’ command for?

598


What does grep v grep do?

534


Write a command to display a file’s contents in various formats?

608


How do I find previous commands in unix?

581


Which command is used to create a directory?

552