Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

directory structure

Status
Not open for further replies.

OieL

MIS
Sep 6, 2002
17
0
0
US
hi,

how can I list a directory structure and making a copy of it at the same time ...

thanks
 
Not at the same time, but close:

function listfiles() {
target=${1:-$PWD}
listing=`ls -l $target` ; echo $listing
}
 
list && copy ??
mkdir /tmp/qqq
cd yourdir;tar cfvb - 126k .|(cd /tmp/qqq;tar xfp -)
c = create
f = file
v = verbose, you get the list
b = block size
- = file to create, stdtout the second - is stdin
126k = blocksize
....
see 'man tar ufsdump ...' -----------
when they don't ask you anymore, where they are come from, and they don't tell you anymore, where they go ... you'r getting older !
 
If you just want the directories, and not the files, try:
Code:
find $SRC -type d | tee | cpio -p -d $DEST
Cheers, Neil
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top