LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Copying a file into a directory (https://www.linuxquestions.org/questions/linux-newbie-8/copying-a-file-into-a-directory-281315/)

Nizhni 01-23-2005 03:10 PM

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

SciYro 01-23-2005 03:14 PM

cp ~/turboprint.tpkey ~/turboprint-1.91

paste any errors you got, as it should have errored out if it didn't work

Nizhni 01-23-2005 04:38 PM

Thanks. I find it confusing where you should and should not type a / in a command.

Tom

slakmagik 01-24-2005 12:47 AM

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.


All times are GMT -5. The time now is 01:37 PM.