what is the difference between Touch & cat command

Answer Posted / sivasankar.s

cat command displays the contents of the file.

Ex :
$ cat fruits.txt
apple
orange
grapes

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

before use touch command
$ls -ltr
-rw-r--r-- 1 s aaa 20 Oct 29 16:39 fruits.txt

$ touch fruits.txt

$ls -ltr
-rw-r--r-- 1 s aaa 20 Oct 29 16:51 fruits.txt

Is This Answer Correct ?    56 Yes 12 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain mount and unmount command.

611


Write a command to kill the last background job?

618


What are grep patterns?

575


When i run a programm of orphan process. Instead of getting child's parent (ppid)=1 ..i get 1400 and it varies as per system. How can i findthe right soluion??? My pgm: #include # include int main() { int pid; pid=fork(); if(pid < 0) {exit(-1);} else if(pid==0) { printf("Child Process is Sleeping ..."); sleep(10); printf("Orphan Child's Parent ID : %u ",getppid()); } else { printf("Parent Process Completed ... %u ",getpid()); exit(0); } return 0; } Output:

1758


What is the use of tee command?

567






Using unix command how to display no of records in oracle?

604


What is the functionality of a top command?

623


What is $0 bash?

646


why metadb requires a seperate slice to create Solaris volume manager

2552


What is sed awk grep?

602


What is the size of time_t?

642


Explain ‘system calls’ with respect to unix commands?

599


hw will u use awk in replacing cahrs and files

2726


What are filter commands in unix?

553


What is the first character of the output in ls l command?

629