Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 01-23-2005, 03:10 PM   #1
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?

Old 01-23-2005, 03:14 PM   #2
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, 04:38 PM   #3
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.

Old 01-24-2005, 12:47 AM   #4
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.


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

All times are GMT -5. The time now is 12:45 PM.

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