Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 01-22-2008, 09:37 PM   #1
LQ Newbie
Registered: Jan 2008
Posts: 2

Rep: Reputation: 0
Why won't it let me copy or move a file from one directory to another?

Ok. I have some programming experience but it's all in the R language. I'm trying to self teach myself C++ here and I have been messing around with Linux here for an hour. That is my experience. lol. But yea I know this is a very simple question but I just have no idea what I am doing wrong.

When I use either cp (copy) or mv (move) to try and move a specific file from one directory to another I just get a message that says cp: or mv: cannot create/move regular file 'x': permission denied.

Why won't it let me move it?

Old 01-22-2008, 09:43 PM   #2
Senior Member
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,141

Rep: Reputation: 168Reputation: 168
Can you post the full command that you typed? It could be just a syntax error - it might be that you don't have permission to write to the destination (or to remove the source).
Old 01-22-2008, 09:44 PM   #3
LQ Guru
Registered: Feb 2003
Location: Mineral, Virginia
Distribution: Debian 8
Posts: 7,893

Rep: Reputation: 339Reputation: 339Reputation: 339Reputation: 339
Linux has an elaborate security system. Your computer is actually set up as a network of users. Each directory and file has ownership and permissions fields. Whether you are allowed to read, write, or execute a file depends on the ownership and permissions of that file. Use the ls command to display the ownership and permissions of the file(s) that you are not allowed to modify. For example:

ls -l /boot/grub/menu.lst

ls -l

ls -l /home/(your username)/*

man ls

Steve Stites
Old 01-22-2008, 10:54 PM   #4
LQ Newbie
Registered: Jan 2008
Location: /home/chris
Distribution: Zenwalk, Backtrack 2
Posts: 20

Rep: Reputation: 0
You're probably not going to have privileges above read, for anything outside of /home/yourname. If you need to move a file/folder someplace else, you'll need to use sudo. Ex:

sudo mv /home/chris/Desktop/myfolder /opt/lampp/htdocs
Or if you're still having problems, and really need it moved, use su, I'm assuming you have root access. Ex:

su (enter)
password for su:
Then you'll have access to anything, and everything. So once you move your folder, be sure to switch back to your normal permissions! To do so, just type exit, and hit enter.
Old 01-23-2008, 12:31 AM   #5
Registered: Feb 2006
Location: Australia
Distribution: Linux... :-)
Posts: 241
Blog Entries: 1

Rep: Reputation: 50
you dont have permission to do that to that particular file, BUT you can by using chmod

these links may help explain this for you...
chmod allows you to change the permissions, but beware, if you move a critical file, then bye bye install...
have fun...

Last edited by wraithe; 01-23-2008 at 12:34 AM. Reason: typo


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
copy file to another directory johnrage Linux - Newbie 1 02-25-2006 01:30 AM
how do i get permission to move file into directory timalan SUSE / openSUSE 2 08-24-2005 09:25 PM
How to do recursive file copy of directory for specific files? Arodef Linux - Newbie 4 06-29-2004 05:35 PM
Please help, how do I copy one file to another directory lexington Linux - Newbie 4 04-04-2004 10:17 AM
Is it possible to move file from /dev to other directory? raindrop Linux - Hardware 2 11-13-2002 05:37 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:39 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration