Solved

Cannot move a file on Unix

Posted on 2013-05-20
8
422 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
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 77

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
Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

 
LVL 84

Expert Comment

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

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 150 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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

My previous tech tip, Installing the Solaris OS From the Flash Archive On a Tape (http://www.experts-exchange.com/articles/OS/Unix/Solaris/Installing-the-Solaris-OS-From-the-Flash-Archive-on-a-Tape.html), discussed installing the Solaris Operating S…
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…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
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.

816 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now