LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Command line syntax - No such file or directory exists (https://www.linuxquestions.org/questions/linux-newbie-8/command-line-syntax-no-such-file-or-directory-exists-912057/)

Mountaineer 11-05-2011 02:59 PM

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.

spiky0011 11-05-2011 03:01 PM

try cp -r for directories

sgosnell 11-05-2011 03:51 PM

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.

Mountaineer 11-06-2011 10:22 AM

Command line problems
 
Many thanks.

Mountaineer

suicidaleggroll 11-06-2011 12:31 PM

It sounds like /home/Documents/ doesn't exist.

Mountaineer 11-06-2011 12:39 PM

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.

repo 11-06-2011 12:45 PM

Quote:

cp /home/scott/"Services - NY.xls" /home/Documents/
Does
Code:

/home/Documents
exist?
Do you have write access to
Code:

/home/Documents
Don't you mean
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.
If you refer to it by
Code:

/Documents
you refer to the Documents folder in the "/" directory, not "/home"

Kind regards

suicidaleggroll 11-06-2011 12:51 PM

/ 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")

Mountaineer 11-06-2011 01:10 PM

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.

repo 11-06-2011 01:12 PM

Code:

cp /home/scott/"Services - NY.xls" /home/scott/Documents/

Kind regards

Mountaineer 11-06-2011 02:55 PM

Command line problems
 
Thanks again. Now I get it. I was close but not enough. This language is unforgiving.

jschiwal 11-06-2011 03:09 PM

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.