Welcome to the most active Linux Forum on the web.
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 03-03-2012, 08:26 AM   #1
Registered: Feb 2012
Posts: 58

Rep: Reputation: Disabled
copy files

how can i copy file from another user's directory to mine

i wrote a code
cp /home/micky/wishes.txt wish
where micky is my another user
and wishes.txt is a file in micky.

but i got error as
cp: cannot stat '/home/micky/wishes.txt' : Permission denied

can anyone tell correct command for it
Click here to see the post LQ members have rated as the most helpful post in this thread.
Old 03-03-2012, 08:35 AM   #2
Senior Member
Registered: Sep 2010
Distribution: Debian
Posts: 1,632
Blog Entries: 3

Rep: Reputation: 346Reputation: 346Reputation: 346Reputation: 346
The command is correct - the problem is that you're not allowed to read other people's documents. You wouldn't want people copying all your personal and secret files over to their user areas!

However, if you have access to sudo privileges, then you should be able to run:

sudo cp /home/micky/wishes.txt wish
and it will run correctly.

Hope this helps,
Old 03-03-2012, 08:35 AM   #3
Senior Member
Registered: Dec 2010
Location: Internet
Distribution: Linux Mint, SLES, CentOS, Red Hat
Posts: 2,385

Rep: Reputation: 477Reputation: 477Reputation: 477Reputation: 477Reputation: 477
@ Reply

Hi Micky12345,

You cannot copy files from another users home directory with a regular user account only root can do that. And the correct copy command will be:

cp /home/micky/wishes.txt /home/<your user account name>/
2 members found this post helpful.


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
Creating a script to move or copy files into multiple directories below the files matthes138 Linux - Newbie 5 08-25-2009 05:57 PM
in copy files or ls files the command want to invert select some files how to?? hocheetiong Linux - Newbie 3 06-27-2008 07:32 AM
How to find files and copy the found files to the floppy in one command justmehere Linux - Newbie 11 05-05-2008 12:29 AM
Command to copy files/folders but skip bad/corrupt files?? leemoreau Linux - Newbie 2 04-02-2007 03:27 PM
Mepis, copy files to thumb drive, files deleted? vremenno Linux - Newbie 6 09-16-2006 12:21 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:22 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration