Link to home
Start Free TrialLog in
Avatar of ismahwati
ismahwati

asked on

moving files around

Hi..

 i try to move one large .dmp file
 to other disk space.

 let say from /export/m.dmp to /tmp directory

 in export the files is owned by sysops
 
 $ -rwxr-xr-x   1 sysops   dba

 when i cp the file to /tmp

 the owner is root.

 i try to move using sysops id but get error
 'no permission,access denied'

 how can i grant back the file to sysops.

 tq
 sun newbie
Avatar of yuzh
yuzh

If you use cp command, the file permission will change, use
the tar command instead.

  delete the file in tmp first,
     rm /tmp/m.dmp

  make a copy of the file in /export, and put it to /tmp,

  cd /export
  tar cf - m.dmp  | (cd /tmp ; tar xvf -)

  the above commands will do the job for you.

=====
yuzh
Use
cp -p file newfile
with p the owner and group
is same
Avatar of ismahwati

ASKER

i try the cp -p file newfile..

but i does not maintain the owner
it change  the sysops to root / other.

 tq
ASKER CERTIFIED SOLUTION
Avatar of ahoffmann
ahoffmann
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
tq
it helps
tq
it helps
tq
it helps