Hello All,
i have environment in Linux OS but one help required from your end regarding copy .
now explaining description :
I have FS structure like this :
/opt/DevOps/profile/instances/webA/serverices.xml file ,but under webA contain so many files but i need to copy from source path to in /tmp path copy only "webA/services.xml" ( source file with WebA)
similarly copy "webB/services.xml" & "webC/services.xml" .
here in every FS "services.xml" file is common but i need to copy with "webA/services.xml from source to /tmp , webB/services.xml & webC/services.xml .
output sould like :
/tmp/webA/services.xml
/tmp/webB/services.xml
/tmp/webC/services.xml
Note : without create directory under /tmp with WebA,webB,webC but file need to copy respective folder only with specific file copy .
any command for copy like above mentioned output .
could you please share me command if possible .
i am waiting for your valuable reply .
Regards,
Jeesshnasree
Did you try with "man cp" ?
cd /opt/DevOps/profile/instances && cp --parents web{A,B,C}/services.xml /tmp/.
Maybe this?
First, make directories (if it they don't already exist)
mkdir -pv /tmp/Web{A,B,C}
copy file into all directories
for i in A B C; do cp -v services.xml /tmp/Web${i}; done
Did you try with "man cp" ?
cd /opt/DevOps/profile/instances && cp --parents web{A,B,C}/services.xml /tmp/.
Red Hat
Learning Community
A collaborative learning environment, enabling open source skill development.