Linux - DesktopThis forum is for the discussion of all Linux Software used in a desktop context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Trying to copy my documents directory from an external hard drive to another computer.
I've been trying sudo cp -a/Media/Toshiba/Documents/ /Home/jim/Documents.
What am I doing wrong, I always get an error, cp: invalid option -- '/'
I admit I don't understand command line usage and the help suggestions are Greek to me. The computer is a Dell Optiplex 7010.
What am I doing wrong, I always get an error, cp: invalid option -- '/'
I admit I don't understand command line usage and the help suggestions are Greek to me. The computer is a Dell Optiplex 7010.
You don't tell us what version/distro of Linux, but did you look at the command line you posted?? There needs to be a space after the "-a", and no period after the "Documents", if that's the exact command line you typed in. Also, /home is rarely capitalized. And do you have any files that start with a dash??
After fourteen years of Linux usage, you should be well aware that Linux is case sensitive. And if you find the CLI to be 'Greek', then why don't you use any file manager of your choice and drag/drop them to where you want???
I copy-pasted your suggestion, it returned an error.
cp: cannot stat '/Media/Toshiba/Documents/*': No such file or directory
Command 'cp:' not found, did you mean:
command 'cpr' from deb node-cpr (3.0.1-4)
command 'cpp' from deb cpp (4:11.2.0-1ubuntu1)
command 'cpm' from deb cpm (0.32-1.3)
command 'cp' from deb coreutils (8.32-4.1ubuntu1)
command 'cpu' from deb cpu (1.4.3-13build1)
command 'cph' from deb conda-package-handling (1.7.3-2build1)
Try: sudo apt install <deb name>
TBOne
Thank you for suggesting I use file manager, that's what I had been seeking, but everything I could find by searching was to use the command line.
I got the documents copied by using nemo. I seldom need to do more file moving than putting onto a USB stick or copying from one, so don't get much practice. The OS is Linux Mint 21.1 Vera Cinnamon. No I didn't intend to end the command with a period, it's force of habit to end a sentence that way, and I overlooked it. I'll mark this as solved.
cp: cannot stat '/Media/Toshiba/Documents/*': No such file or directory
External drives are typically mounted at /media/... It isn't evident if what you posted in #1 are typos or the actual command used. linux is case sensitive.
one problem is that you need to add a space after -a:
Code:
cp -a /Media/.....whatever
^
In your original post I can't see that space. Otherwise if you are not familiar with the command line use some kind of GUI. But without details hard to say more.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.