Linux - Moving/Copying Files via terminal

  • Thread starter Thread starter Arman777
  • Start date Start date
  • Tags Tags
    files Linux
Click For Summary
SUMMARY

The discussion focuses on moving and copying files and directories in Linux using terminal commands, specifically the `mv` and `cp` commands. The correct syntax for moving directories is `mv dir1 dir2`, while copying files can be done with `cp -vr Downloads/* .`, where `-v` enables verbose output. Users should be cautious when using these commands, especially when files with the same names exist in the destination directory, as this may lead to overwriting. The discussion also references a tutorial on the `mv` command for further guidance.

PREREQUISITES
  • Basic understanding of Linux terminal commands
  • Familiarity with file system structure in Linux
  • Knowledge of command-line options for `cp` and `mv` commands
  • Experience with handling file permissions in Linux
NEXT STEPS
  • Research the `cp` command options, particularly `-r` for recursive copying
  • Learn about file overwriting behavior in Linux when using `mv` and `cp`
  • Explore the use of `rsync` for more advanced file transfer scenarios
  • Study the implications of using `-i` (interactive) option with `mv` and `cp` commands
USEFUL FOR

Linux users, system administrators, and anyone looking to efficiently manage file operations via the terminal.

Arman777
Insights Author
Gold Member
Messages
2,163
Reaction score
191
I am trying to move files and folders from one directory to other. Both of the files has multiple subfolders and files.

From the reasearch I have made it seems that the answer should be something like,

`cp mv -vr \Downloads\* .`

But I am not sure this is true or not. I am also not sure about using mv or copy. The files that I am copying have the same file names but the content is different.

Is this command correct ? Do I need '-v` argument ?
 
Technology news on Phys.org
Yes sorry it’s that darn spellcheck acting up again. I’m in Yosemite with spotty internet and tried to fix it but lost the signal.
 
Last edited:
Thanks for the help..
 
  • Like
Likes   Reactions: berkeman and jedishrfu

Similar threads

  • · Replies 20 ·
Replies
20
Views
4K
  • · Replies 9 ·
Replies
9
Views
3K
  • · Replies 16 ·
Replies
16
Views
7K
  • · Replies 9 ·
Replies
9
Views
1K
  • · Replies 1 ·
Replies
1
Views
3K
Replies
7
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 1 ·
Replies
1
Views
4K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 1 ·
Replies
1
Views
5K