Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

what is the difference between Touch & cat command

Answer Posted / shruthi

with cat one can perform following:
1. copy
$cat file1 > file2
2. display
$cat file1
3. create
$cat > file1
4. append
$cat file1 >> file2

with touch command one can create a file of 0 bytes later
you can use it like any other regular files. it is not
replacement for cat. but yet another command.
you cannot perform copy(redirection), display and
concatenation with touch.

which command to use, depends on what is your requirement.
say, you are installing oracle and you have not given proper
permission to oracle users home directory, in that case just
to check it, you can use touch command. here you are
interested in knowing whether you as a oracle user have
permission to write to that directory and not in creating a
file with some contents which you will use in future to do
some manipulation.

Is This Answer Correct ?    25 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between awk and grep?

1272


How do I find previous commands in unix?

1196


Write a command that will allow a unix system to shut down in 15 minutes, after which it will perform a reboot.

1255


How do I search for a file in unix command?

1025


Explain mount and unmount command.

1231


What is the pipe command?

1203


What is the comma to display different lines that are found when compare two files?

1166


Give the command for finding the current date.

1128


What is “chmod” command?

1189


Explain command to show the space allocation of files?

1130


How do I clear my terminal history?

1186


Is there any method to erase all files in the current directory, along with its all sub-directories, by using only one command?

1236


What is s and g in sed command?

1120


What does find command return in unix?

1165


Explain command to view process running?

1146