LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices



Reply
 
Search this Thread
Old 01-22-2008, 10:37 PM   #1
dewjunkie
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?

Thx!
 
Old 01-22-2008, 10:43 PM   #2
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,123

Rep: Reputation: 162Reputation: 162
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, 10:44 PM   #3
jailbait
Guru
 
Registered: Feb 2003
Location: Blue Ridge Mountain
Distribution: Debian Wheezy, Debian Jessie
Posts: 7,592

Rep: Reputation: 188Reputation: 188
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, 11:54 PM   #4
Chris.C
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:

Code:
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:

Code:
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, 01:31 AM   #5
wraithe
Member
 
Registered: Feb 2006
Location: australia
Distribution: Linux... :-)
Posts: 216
Blog Entries: 1

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


http://catcode.com/teachmod/

http://www.ss64.com/bash/chmod.html

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 01:34 AM. Reason: typo
 
  


Reply


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 02:30 AM
how do i get permission to move file into directory timalan Suse/Novell 2 08-24-2005 10:25 PM
How to do recursive file copy of directory for specific files? Arodef Linux - Newbie 4 06-29-2004 06:35 PM
Please help, how do I copy one file to another directory lexington Linux - Newbie 4 04-04-2004 11:17 AM
Is it possible to move file from /dev to other directory? raindrop Linux - Hardware 2 11-13-2002 06:37 PM


All times are GMT -5. The time now is 04:01 PM.

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