Sanjoy Roy

[MCM, MCP, SCJP] – Senior PHP Programmer

Copy recursively directory structure using Linux Command


How to copy a directory/folder structures in a single command
Create a new directory
Cd new_directory
Run the following command
Where “../catalog” is the source location
***Remember to backup before running this script.

e.g

find ../catalog -type d -printf “%P\n” | xargs mkdir -p

find ../admin -type d -printf “%P\n” | xargs mkdir -p

Comments are closed.