Linux: copy folder from one user to another

  • Thread starter Thread starter huntflex
  • Start date Start date
  • Tags Tags
    Linux
Click For Summary
SUMMARY

The discussion centers on the correct method to copy folders between users in a Linux environment. The user initially attempted to use the command cp -r /olduser/folder ./newuser/folder, which resulted in a "no such file or directory" error. The correct approach involves specifying the destination path accurately, such as /newuser/folder or ~newuser/folder, to ensure the folder is copied to the intended user's home directory.

PREREQUISITES
  • Understanding of Linux command line operations
  • Familiarity with the cp command and its options
  • Knowledge of user directory structures in Linux
  • Basic permissions management in Linux
NEXT STEPS
  • Research Linux file permissions and ownership management
  • Learn about the rsync command for efficient file transfers
  • Explore advanced cp command options and use cases
  • Study user and group management in Linux systems
USEFUL FOR

This discussion is beneficial for Linux system administrators, users managing multiple accounts, and anyone needing to transfer files securely between user directories.

huntflex
Messages
26
Reaction score
0
Hello,

I'm having trouble copying some folders from one user to another. I've attempted something like this:

cp -r /olduser/folder ./newuser/folder

it just tells me no such file or directory
Can anybody please help ?

Thank you
 
Physics news on Phys.org
Don't you mean /newuser/folder?
Or ~newuser/folder, if you want to put it in their homedir?
Or ~newuser, if you don't want it in ~newuser/folder/folder?
 

Similar threads

  • · Replies 35 ·
2
Replies
35
Views
5K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 20 ·
Replies
20
Views
5K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 4 ·
Replies
4
Views
1K
  • · Replies 24 ·
Replies
24
Views
11K
  • · Replies 9 ·
Replies
9
Views
2K