//View Tip #171
» Directories and its size
» Remove comments and blank lines
» Mass-renaming files
» Copy and paste from the command line
Similar Tips
» Being selfish - Kick all users except you» Directories and its size
» Remove comments and blank lines
» Mass-renaming files
» Copy and paste from the command line
Latest tips by RSS
Click here to subscribe
Follow Shell-Fu on Twitter
Click here to follow
Follow Shell-Fu on identi.ca
Click here to follow
The following command creates in the /usr/project directory, a copy of the current working directory structure:
find . -type d -print|sed 's@^\.\{0,1\}@/usr/project@' | sed 's/ /\\ /' | xargs mkdir -pComments
Add your comment
Comments are currently disabled


find . -type d -print | cpio -pudmv /usr/project
That accomplishes the same thing with no string manipulation required.