what is the difference between Touch & cat command

Answer Posted / lafir gk

touch:- This can be used to create a file with size 0 and
to change the time stamp of a file.

cat:- This can be used to display the content of a
file,concatinate etc.

Ex :
# cat Example.txt
AIX
HPUX
SOLARIS
LINUX

touch command changes the modified date and time of the
file.

before use touch command
#ls -ltr
-rw-r--r-- 1 s file1 02 Nov 29 19:24 Example.txt

# touch Example.txt

#ls -ltr
-rw-r--r-- 1 s file1 02 Nov 29 19:43 Example.txt

Is This Answer Correct ?    12 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the search command in unix?

607


Describe the zip/unzip command using gzip.

615


What is the comma to show the space allocation of files?

562


What is the use of the command 'ls -x chapter[1-5]' ?

663


How does pipe () work?

597






What is awk used for?

624


Is command prompt unix?

586


What do chmod, chown, chgrp commands do?

641


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

801


What is unix command?

584


what is the advaantage of each user having its own copy of the shell?

2039


What is {} in find command?

584


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

648


hw will u use awk in replacing cahrs and files

2736


Can you enlist some commonly used network commands?

604