sunilbains
asked on
cp-issue in unix
When i try
cp /home/njifcip/stmtpim/wmr/ * /home/nyistpp/stmt/data/wm r/
cp: cannot create regular file `/home/nyistpp/stmt/data/w mr/abc.txt ': Permission denied
Why i am getting this error.
Both path have wmr directory full permission.
I created test dir under wmr and could perform successful copy
Please advise.
cp /home/njifcip/stmtpim/wmr/
cp: cannot create regular file `/home/nyistpp/stmt/data/w
Why i am getting this error.
Both path have wmr directory full permission.
I created test dir under wmr and could perform successful copy
Please advise.
ASKER
i tried ls -l /home/njifcip/stmtpim/wmr/ abc.txt
and getting following output
-rw-r--r-- 1 njifcip pcs-tech--1 717336 Oct 22 02:09 /home/njifcip/stmtpim/wmr/ abc.txt
Does not seem to be link?
and getting following output
-rw-r--r-- 1 njifcip pcs-tech--1 717336 Oct 22 02:09 /home/njifcip/stmtpim/wmr/
Does not seem to be link?
Right.
What do you get with
ls -ld /home/nyistpp/stmt/data/wm r
and
id
?
What do you get with
ls -ld /home/nyistpp/stmt/data/wm
and
id
?
ASKER
$ ls -ld /home/nyistpp/stmt/data/wm r
drwxrwxrwx 5 nyistpp games 4096 Oct 26 12:34 /home/nyistpp/stmt/data/wm r
wmr]$ id
uid=72619(nyoteapb) gid=20(games) groups=20(games)
drwxrwxrwx 5 nyistpp games 4096 Oct 26 12:34 /home/nyistpp/stmt/data/wm
wmr]$ id
uid=72619(nyoteapb) gid=20(games) groups=20(games)
the dir is owned by other user nyistpp and file abc.txt is owned by other user njifcip and you have read only on that file
/home/njifcip/stmtpim/wmr/ abc.txt already exists and is owned by another user, so you cannot overwrite it, however you are still permitted to create new files or directories because /home/njifcip/stmtpim/wmr is world-writable. This is exactly how the system should act.
ASKER
Hello xterm,
what is the alternative solution?
should we have 777 permission on tgt-- /home/nyistpp/stmt/data/wm r/ existing files.
what is the alternative solution?
should we have 777 permission on tgt-- /home/nyistpp/stmt/data/wm
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Check with
ls -l /home/njifcip/stmtpim/wmr/
If it's indeed a link use the "-P" flag to copy links as links, if appropriate.
wmp