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 awk command used for?

597


Which command can you use to find the currently running process in unix server?

586


How do I find previous commands in unix?

592


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

2034


Name the general commands in using unix os for a beginner?

621






How do I clear my terminal history?

581


What does grep v do?

557


Is it inbetween or in between?

579


Can you enlist some commonly used network commands?

599


What is unix command line?

606


What is pipe command in unix?

669


What is the difference between grep and grep?

563


What is the use of egrep command in unix?

624


How do I use grep to search for a file?

580


How is the command '$cat file2 ' different from '$cat >file2 and >> redirection operators ?

759