LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 12-22-2009, 09:10 AM   #1
voyciz
Member
 
Registered: Mar 2004
Distribution: Slackware
Posts: 425

Rep: Reputation: 40
cat vs cp


Hello. I noticed that in the build scripts for various software for Slackware packages (slackbuilds.org), rather than saying this:

Code:
cp TXTFILE NEWDIR/TXTFILE
it does this

Code:
cat TXTFILE > NEWDIR/TXTFILE
Why would this be? I did notice that using cat doesn't preserve the permissions, but is there anything else? Some sort of performance thing? Just curious. Thanks all.
 
Old 12-22-2009, 12:16 PM   #2
ozanbaba
Member
 
Registered: May 2003
Location: İzmir
Distribution: Slackware64 15.0 Multilib
Posts: 778

Rep: Reputation: 135Reputation: 135
maybe cat could do better at it as it's simply read there, write here program.

probably just for not preserving permissions, and ownerships. (well actually cat does not copy, it reads from somewhere then writes it somewhere else).

Last edited by ozanbaba; 12-22-2009 at 12:28 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
cat onelinefile.txt >> newfile.txt; cat twofile.txt >> newfile.txt keep newline? tmcguinness Programming 4 02-12-2009 06:38 AM
Using cat readline within cat readline while loop demxkn66 Programming 5 12-16-2007 05:10 PM
cat in asm/ cat --show-all option Tux Linux - Software 1 09-02-2006 09:31 PM
Cat intervade Linux - Newbie 7 05-21-2006 02:18 PM
cat notsoevil Linux From Scratch 3 02-14-2002 10:16 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 11:39 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration