Command line syntax - No such file or directory exists
Linux - NewbieThis 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
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.
Command line syntax - No such file or directory exists
I type:
cp /home/scott/"Services - NY.xls" /home/Documents/
I get cp: cannot create regular file
'/home/Documents/': Is a directory
I type:
mv (same syntax)
I get mv: cannot stat No such file or directory
I have studied three intro guides and referred to one book on Linux, but still am stumped by the syntax. I was once adept in DOS and would like to master this. If you can point out my error and/or recommend a more detailed source, I'd appreciate it.
OK, I read the other post. I'm misusing "syntax" Let's say "arguments" I apologize.
cp by itself copies only a file. If you want to copy multiple files in a directory to another directory, you need to use 'cp -R'. It's the same for mv.
To get more detailed information, type 'man cp' and/or 'man mv' into a terminal. Man is the command to display the manual pages for a command. You can man any terminal command and get the manual page for it. Or use 'command --help' for a shorter help summary.
I don't understand. I don't need the /home since I'm already in /home. There is a Documents folder in /home, so I refer to it by /Documents. Do T know that /home and /Documents exist. I guess that I'm not following you. Please elaborate. And thanks for listening.
/ is a directory in Linux, the highest level directory in the filesystem.
When you say /home, you're referring to a directory in / called home.
When you say /Documents, you're referring to a directory in / called Documents. Documents isn't in / though, from what you just said it's in /home.
You could reference it by /home/Documents, or if you're already in /home, you could simply refer to it by Documents or ./Documents (notice the . in front of /, . means "here")
Isn't my original command referenced as you say,ie; /home/Documents? I did include the /scott in my original post.
I probably could have typed cp "file.xls" Documents, without all the path. I had the .xls file in my home directory and I wanted to move it to my Documents directory.I'm very grateful for both (all) your comments. But if I could see the command written properly, maybe it would penetrate.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.