![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| absolute path | Kirichiko | UNIX for Dummies Questions & Answers | 2 | 10-03-2007 03:30 AM |
| $PWD shows absolute path vs path w/symbolic links | kornshellmaven | Shell Programming and Scripting | 3 | 06-13-2007 09:15 AM |
| absolute path | filedeliver | High Level Programming | 4 | 06-05-2007 02:18 PM |
| vi - replacing a relative path with absolute path in a file | Yinzer955i | UNIX for Dummies Questions & Answers | 2 | 09-07-2006 08:47 AM |
| HOW to make absolute path???? HELP | youngvet | High Level Programming | 1 | 11-01-2003 01:58 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
hi all,
can i get script find file & copy that file with path for an example sourse : /home/abc/ destination : /home/backup/ files which need to find : tmp* copy these files with its absolute path inside like :- /home/abc/x/y/z/tmp.txt to /home/backup/date/x/y/z/tmp.txt thanks in advance |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
The customary tool for this would be tar.
Code:
cd /home/abc test -d /home/backup/date || mkdir /home/backup/date find -type f -name 'tmp*' -print | tar cf - | ( cd /home/backup/date ; tar xf - ) rsync is also nice and efficient if you have that. |
|
#3
|
|||
|
|||
|
find & copy files with absolute path
Quote:
thanks for reply hey can we do this using cp command. i tried like this but it prints error test=$(find /home/user/ -name test* -print0) for i in $test; do cp -a $i /home/user/tmp/; done whts wrong in my script Last edited by jagnikam; 05-14-2008 at 09:15 AM. |
|
#4
|
|||
|
|||
|
find & copy files with absolute path
please help me ASAP.
|
|
#5
|
|||
|
|||
|
It is not clear that cp is the right tool for what you are trying to do.
|
|
#6
|
|||
|
|||
|
You can try it with find and cpio, something like:
Code:
cd /home/abc find tmp* -print | cpio -pvdmu /home/backup Regards |
|
#7
|
|||
|
|||
|
find & copy files with absolute path
Quote:
this script create folder named as "tmp" in tmp folder it does not find & copy files starts with "tmp*" what i want script search the file "tmp" in abc & its subfolder & copy to destination |
|||
| Google The UNIX and Linux Forums |