?
Solved

Cannot move a file on Unix

Posted on 2013-05-20
8
Medium Priority
?
428 Views
Last Modified: 2013-05-21
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
0
Comment
Question by:YZlat
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
8 Comments
 
LVL 84

Expert Comment

by:ozo
ID: 39182591
are you oracle?
0
 
LVL 14

Expert Comment

by:quizwedge
ID: 39182596
On the off chance this is an easy one, are you logging in as the user oracle? Have you tried using sudo?
0
 
LVL 79

Expert Comment

by:arnold
ID: 39182906
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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 84

Expert Comment

by:ozo
ID: 39183027
you might also check ls -ld .
0
 
LVL 79

Expert Comment

by:arnold
ID: 39183271
df -k
Is /MyDir its own partition?

Wait a second, why are you using /MyDir?

mv myfile.txt MyDir
0
 
LVL 84

Accepted Solution

by:
ozo earned 600 total points
ID: 39183413
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
 
LVL 35

Author Closing Comment

by:YZlat
ID: 39184108
Thanks!
0
 
LVL 84

Expert Comment

by:ozo
ID: 39184130
arnold was the first to suggest that you might not have meant to move the file to /MyDir
0

Featured Post

New benefit for Premium Members - Upgrade now!

Ready to get started with anonymous questions today? It's easy! Learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When you do backups in the Solaris Operating System, the file system must be inactive. Otherwise, the output may be inconsistent. A file system is inactive when it's unmounted or it's write-locked by the operating system. Although the fssnap utility…
Why Shell Scripting? Shell scripting is a powerful method of accessing UNIX systems and it is very flexible. Shell scripts are required when we want to execute a sequence of commands in Unix flavored operating systems. “Shell” is the command line i…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.
Suggested Courses

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question