xcopy in unix

Posted on 1999-01-07
Last Modified: 2012-06-27
I am using unix 386 ver 3.2.
I want to know if i can copy a whole directory along with all sub-directories as with dos xcopy command.
Question by:angshuman_b
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
LVL 22

Accepted Solution

blu earned 50 total points
ID: 2008666
Try something like this:

tar cf - dirtocopyfrom | (cd dirtocopyto ; tar xf - )
tar cf - * | (cd dirtocopyto ; tar xf - )


Expert Comment

ID: 2008667
$ cp -rp sourcedir destdir

or (if you want to preserve also last modification time)

$ find sourcedir | cpio -pdm destdir

Expert Comment

ID: 2008668
$ cp -rp sourcedir destdir

or (if you want to preserve also last modification time)

$ find sourcedir | cpio -pdm destdir

Expert Comment

ID: 2008669
cp -r sourcedir destdir

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When you do backups in the Solaris Operating System, the file system must be inactive. Otherwise, the output may be inconsistent. A file system is inactive when it's unmounted or it's write-locked by the operating system. Although the fssnap utility…
Why Shell Scripting? Shell scripting is a powerful method of accessing UNIX systems and it is very flexible. Shell scripts are required when we want to execute a sequence of commands in Unix flavored operating systems. “Shell” is the command line i…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Suggested Courses

710 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question