LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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


Reply
  Search this Thread
Old 11-05-2011, 02:59 PM   #1
Mountaineer
Member
 
Registered: Oct 2011
Location: Keene, NY
Distribution: 11.10
Posts: 33
Blog Entries: 1

Rep: Reputation: 2
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.
 
Old 11-05-2011, 03:01 PM   #2
spiky0011
Senior Member
 
Registered: Jan 2011
Location: PLANET-SPIKE
Distribution: /LFS/Debian
Posts: 2,511
Blog Entries: 1

Rep: Reputation: 412Reputation: 412Reputation: 412Reputation: 412Reputation: 412
try cp -r for directories
 
1 members found this post helpful.
Old 11-05-2011, 03:51 PM   #3
sgosnell
Senior Member
 
Registered: Jan 2008
Location: Baja Oklahoma
Distribution: Debian Stable and Unstable
Posts: 1,943

Rep: Reputation: 542Reputation: 542Reputation: 542Reputation: 542Reputation: 542Reputation: 542
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.

Last edited by sgosnell; 11-05-2011 at 03:54 PM.
 
1 members found this post helpful.
Old 11-06-2011, 10:22 AM   #4
Mountaineer
Member
 
Registered: Oct 2011
Location: Keene, NY
Distribution: 11.10
Posts: 33

Original Poster
Blog Entries: 1

Rep: Reputation: 2
Command line problems

Many thanks.

Mountaineer
 
Old 11-06-2011, 12:31 PM   #5
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573

Rep: Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142
It sounds like /home/Documents/ doesn't exist.
 
Old 11-06-2011, 12:39 PM   #6
Mountaineer
Member
 
Registered: Oct 2011
Location: Keene, NY
Distribution: 11.10
Posts: 33

Original Poster
Blog Entries: 1

Rep: Reputation: 2
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.
 
Old 11-06-2011, 12:45 PM   #7
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,529

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
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

Last edited by repo; 11-06-2011 at 12:46 PM.
 
Old 11-06-2011, 12:51 PM   #8
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573

Rep: Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142
/ 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")
 
Old 11-06-2011, 01:10 PM   #9
Mountaineer
Member
 
Registered: Oct 2011
Location: Keene, NY
Distribution: 11.10
Posts: 33

Original Poster
Blog Entries: 1

Rep: Reputation: 2
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.
 
Old 11-06-2011, 01:12 PM   #10
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,529

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
Code:
cp /home/scott/"Services - NY.xls" /home/scott/Documents/

Kind regards
 
1 members found this post helpful.
Old 11-06-2011, 02:55 PM   #11
Mountaineer
Member
 
Registered: Oct 2011
Location: Keene, NY
Distribution: 11.10
Posts: 33

Original Poster
Blog Entries: 1

Rep: Reputation: 2
Command line problems

Thanks again. Now I get it. I was close but not enough. This language is unforgiving.
 
Old 11-06-2011, 03:09 PM   #12
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
Using Tab completion will complete partially typed file names and directories, escaping "evil" characters. This will make typing more forgiving.
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Bash: No such file or directory, when file actually exists. SkyerSK Linux - Software 13 02-06-2011 04:33 AM
cannot create directory even if file exists pratikvimal Linux - Newbie 7 06-15-2009 03:51 AM
Command line syntax Steve36810 Linux - Newbie 2 02-24-2009 02:29 PM
no such file or directory exists when trying to execute a exe ryedawg Linux - Software 5 12-05-2005 05:42 AM
xmms command line syntax xviddivxoggmp3 Linux - Software 11 03-12-2004 01:22 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:09 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration