Copying files... I'm confused...


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Copying files... I'm confused...
# 1  
Old 04-03-2011
Copying files... I'm confused...

Hi, I'm new to linux and unix and I'm learning. I have no problem with copying files with "cp" command.
I'm following unixacademy dvd training and for some reason there's recommendation to learn copying files with "cpio" command. As to me, this "cpio" method is much more complex, hard to remember and what is the benefit of using it? Aren't all "cp" commands alike? I understand that there are many ways to accomplish the same task, but why such basic task as copying files should be outsourced to "cpio"? I suspect there's some good reason for it. Can someone, please, point me to a reason of using "cpio" instead of "cp"?

Thanks!
# 2  
Old 04-03-2011
I rarely use cpio myself. Originally cp could not do recursive copies. But cpio can do lots of stuff the cp still cannot do. Like copying a bunch of files into a cpio archive. The other utility that can do that is tar, which is what I like. tar and cpio compete to a certain extent. Another utility called pax was written to handle both cpio and tar archives. You really need to know all of these. They are all in operation. If someone hands you a cpio archive containing some program and asks you to install it, cp isn't going to help you.
# 3  
Old 04-03-2011
A lot of people and material seem to be evangelical about using cpio. But it's ancient, very hard to use, doesn't support large files, and isn't even a standard UNIX utility any more, though! tar and cp remain so. In the end, it's just a choice, like what editor you use.
# 4  
Old 04-05-2011
I understand that "cp" will not help with "cpio" archive, it is clear. I've been asking about, why it is used as a replacement of "cp". So "cp" initially could't copy recursively... is that the main reason why "cpio" could be the tool for copying files?
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Copying files

I'm trying to do this exact same thing, so far I have created this to move files i've named my script CP.sh #!/bin/bash cd /root/my-documents/NewDir/ for f in *.doc do cp -v $f root/my-documents/NewDir $f{%.doc} done When i go to run this in the console i type, bin/sh/ CP.sh but it... (7 Replies)
Discussion started by: MKTM_93_SIMP
7 Replies

2. Shell Programming and Scripting

Copying files

All, I need to grab and rename common files from several unique directory structures. For example, the directory structures looks like: /unique_dir/common/common/common/person_name_dir/common_file.txt There are over 90,000 of these text files that I'd like to put in a single directory as... (5 Replies)
Discussion started by: hburnswell
5 Replies

3. Shell Programming and Scripting

Copying files excluding some files

Hi, I have a folder which contains files in this format. abc-bin.000001 abc-bin.000002 abc-bin.000003 abc-bin.000004 abc-bin.000005 abc-bin.000006 abc-bin.000007 abc-bin.000008 abc-bin.000009 abc-bin.000010 abc-bin.index I want to copy all the files between abc-bin.000004... (6 Replies)
Discussion started by: arijitsaha
6 Replies

4. Shell Programming and Scripting

Files copying - [ Listed files alone. ] - Shell script

Hi All, I am doing this for svn patch making. I got the list of files to make the patch. I have the list in a file with path of all the files. To Do From Directory : /myproject/MainDir To Directory : /myproject/data List of files need to copy is in the file: /myproject/filesList.txt ... (4 Replies)
Discussion started by: linuxadmin
4 Replies

5. Shell Programming and Scripting

Copying Files

Hi All, I'm trying to list some files from my log directory and files are like this log.20110302_20.gz log.20110302_21.gz log.20110302_22.gz log.20110302_23.gz log.20110303_00.gz log.20110303_01.gz log.20110303_02.gz ............ log.20110311_22.gz log.20110311_23.gz... (2 Replies)
Discussion started by: thelakbe
2 Replies

6. UNIX for Advanced & Expert Users

copying of files by userB, dir & files owned by userA

I am userB and have a dir /temp1 This dir is owned by me. How do I recursively copy files from another users's dir userA? I need to preserve the original user who created files, original group information, original create date, mod date etc. I tried cp -pr /home/userA/* . ... (2 Replies)
Discussion started by: Hangman2
2 Replies

7. Solaris

Copying Files

Hi, I understand that to copy files across server, the feasible way will be using scp command. Am I right? What if the two servers are not connected to a network? If by using a cross cable to link up both the server, what will be the best (fastest) way to copy files across? scp as well? ... (3 Replies)
Discussion started by: user50210
3 Replies

8. Shell Programming and Scripting

copying files

hi I want to copy all files from the current directory and move to .archive file. Moreover,I want to add .bak to each file name, that will be copied. How can I do that? (4 Replies)
Discussion started by: tjay83
4 Replies

9. Solaris

Copying Files and

I am new user to solaris and installed solaris operating system on full Harddisk 120Gb. I am unable to copy music files to desktop and /home directory. One thing happened while registering is- i entered login-root and its password. The message prompted your system is crashed. Is it because of... (1 Reply)
Discussion started by: patilmukundraj
1 Replies

10. UNIX for Dummies Questions & Answers

Copying files

I like to know the command structure of copying files/directories from a unix box using telnet session to a windows box. (4 Replies)
Discussion started by: alpheusm
4 Replies
Login or Register to Ask a Question