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. |
try cp -r for directories
|
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. |
Command line problems
Many thanks.
Mountaineer |
It sounds like /home/Documents/ doesn't exist.
|
Command line problems
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.
|
Quote:
Code:
/home/Documents Do you have write access to Code:
/home/Documents Code:
/home/scott/Documents/ Code:
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. Code:
/Documents Kind regards |
/ 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") |
Command line problems
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. |
Code:
cp /home/scott/"Services - NY.xls" /home/scott/Documents/ Kind regards |
Command line problems
Thanks again. Now I get it. I was close but not enough. This language is unforgiving.
|
Using Tab completion will complete partially typed file names and directories, escaping "evil" characters. This will make typing more forgiving.
|
All times are GMT -5. The time now is 08:04 AM. |