Cannot move a file on Unix

I am trying to move a file into a subdirectory:

mv myfile.txt /MyDir

and getting an error:

mv: /MyDir: The file access permissions do not allow the specified action

The permissions are as follows:

drwxr-xr-x    2 oracle   dba             256 May 20 16:23 MyDir
-rwxr--r--    1 oracle   dba      14327181312 May 20 16:32 myfile.txt
LVL 35
YZlatAsked:
Who is Participating?
 
ozoConnect With a Mentor Commented:
If you really meant a subdirectory,  /MyDir might be considered more of a top level directory, unless you are considering it a subdirectory of /
But / seems a strange place to put myfile.txt
Or maybe that's why you want to move it.
0
 
ozoCommented:
are you oracle?
0
 
quizwedgeCommented:
On the off chance this is an easy one, are you logging in as the user oracle? Have you tried using sudo?
0
Cloud Class® Course: Certified Penetration Testing

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

 
arnoldCommented:
Run who
ls -l myfile.txt
getfacl myfile.txt
The issue might be you do not have rights on myfile.txt.

Try cp first?

An mv is a copy and delete the original.
0
 
ozoCommented:
you might also check ls -ld .
0
 
arnoldCommented:
df -k
Is /MyDir its own partition?

Wait a second, why are you using /MyDir?

mv myfile.txt MyDir
0
 
YZlatAuthor Commented:
Thanks!
0
 
ozoCommented:
arnold was the first to suggest that you might not have meant to move the file to /MyDir
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.