LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 01-23-2005, 04:10 PM   #1
Nizhni
Member
 
Registered: Jan 2005
Location: Oxford, England
Posts: 43

Rep: Reputation: 15
Copying a file into a directory


I'm trying to instal a printer driver and as part of it I have to copy a file in my home directory into a sub-directory of the same (home) directory. The file is called turboprint.tpkey and the sub-directory is turboprint-1.91. I've tried using the cp command as root but I can't make it work. Can someone please spell out exactly what the command line should look like?

Tom
 
Old 01-23-2005, 04:14 PM   #2
SciYro
Senior Member
 
Registered: Oct 2003
Location: hopefully not here
Distribution: Gentoo
Posts: 2,038

Rep: Reputation: 51
cp ~/turboprint.tpkey ~/turboprint-1.91

paste any errors you got, as it should have errored out if it didn't work
 
Old 01-23-2005, 05:38 PM   #3
Nizhni
Member
 
Registered: Jan 2005
Location: Oxford, England
Posts: 43

Original Poster
Rep: Reputation: 15
Thanks. I find it confusing where you should and should not type a / in a command.

Tom
 
Old 01-24-2005, 01:47 AM   #4
slakmagik
Senior Member
 
Registered: Feb 2003
Distribution: Slackware
Posts: 4,113

Rep: Reputation: Disabled
If you're typing a relative path, you leave off the leading /. (And any '../foo' path is relative.)

If absolute, you include it. When you use '~' it's sneaky because it includes the leading slash, standing for $HOME (/home/username). So when you use that, you're using an absolute path you need to remember has a leading / already.

As far as the trailing slash, it often doesn't matter but it should definitely only have one if a directory is intended, never for a file, of course.

I'm sure there are more details, but those are the factors that spring to mind.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Excluding a directory when copying Woodsman Slackware 2 10-30-2005 07:25 PM
Automatically Copying files from the ftp directory into the html directory swatward Linux - General 3 04-17-2005 11:55 PM
Copying the newest file in a directory to another location Transition Linux - General 2 01-14-2005 12:53 PM
Copying etc directory njschroe SUSE / openSUSE 6 12-15-2004 02:45 AM
copying a CD to a directory MrGardenHoseMan Linux - General 2 07-03-2003 07:51 PM

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

All times are GMT -5. The time now is 06:26 AM.

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