Find the answer to your Linux question:
Results 1 to 6 of 6
Hi, I have tried to copy a file from one directory to another but i cant as when i click properties of the folder to change permissions to allow me ...
  1. #1
    Just Joined!
    Join Date
    Apr 2009
    Posts
    38

    Command Line

    Hi,

    I have tried to copy a file from one directory to another but i cant as when i click properties of the folder to change permissions to allow me to copy everything is greyed out.

    So i have tried to do it with the command line but dont really know what i'm doing, i started terminal and changed to root and typed this:

    root@laptop://home/deejay/lhkv# cp home/deejay/lhkv/darkmatter /usr/share/amsn/plugins
    cp: cannot stat `home/deejay/lhkv/darkmatter': No such file or directory
    root@deejays-laptop://home/deejay/lhkv#

    Where am i going wrong?

  2. #2
    Just Joined! TheBoogyMaster's Avatar
    Join Date
    Apr 2009
    Posts
    45
    put here the output of this:

    ls -l home/deejay/lhkv/

    you can change the persmissions on the file like this:

    sudo chmod 774 /File
    or
    sudo chmod -R 774 /file (to put the same thing on the directory and all the files from the directory)

  3. #3
    Just Joined! TheBoogyMaster's Avatar
    Join Date
    Apr 2009
    Posts
    45
    if you have something in the directory you can do:

    sudo cp -R home/deejay/lhkv/darkmatter /usr/share/amsn/plugins

  4. #4
    Linux Guru reed9's Avatar
    Join Date
    Feb 2009
    Location
    Boston, MA
    Posts
    4,651
    Quote Originally Posted by djcrazydiamond View Post
    Hi,

    I have tried to copy a file from one directory to another but i cant as when i click properties of the folder to change permissions to allow me to copy everything is greyed out.

    So i have tried to do it with the command line but dont really know what i'm doing, i started terminal and changed to root and typed this:

    root@laptop://home/deejay/lhkv# cp home/deejay/lhkv/darkmatter /usr/share/amsn/plugins
    cp: cannot stat `home/deejay/lhkv/darkmatter': No such file or directory
    root@deejays-laptop://home/deejay/lhkv#

    Where am i going wrong?
    First, if you want to do it with the file manager, nautilus, you can open it as root using gksu. Type ALT+F2 to open a run dialogue, then gksu nautilus.

    From the command line
    Code:
    sudo cp /path/to/file/filename /path/to/whereitsgoing
    If you want to move a directory, you have to use the recursive flag cp -r or cp -a to maintain the file permissions, time stamps, etc.

  5. #5
    Linux Guru techieMoe's Avatar
    Join Date
    Aug 2004
    Location
    Texas
    Posts
    9,496
    Quote Originally Posted by djcrazydiamond View Post
    So i have tried to do it with the command line but dont really know what i'm doing, i started terminal and changed to root and typed this:
    Code:
    root@laptop://home/deejay/lhkv# cp home/deejay/lhkv/darkmatter /usr/share/amsn/plugins
    cp: cannot stat `home/deejay/lhkv/darkmatter': No such file or directory
    root@deejays-laptop://home/deejay/lhkv#
    Where am i going wrong?
    I'll let others help you with your permissions problem, but the problem I see in your command-line syntax here is your path. I see from your prompt that you are in the "/home/deejay/lhkv" directory. Your command is asking Linux to copy a file called "darkmatter" that is in the "/home/deejay/lhkv/home/deejay/lhkv/" directory. You're missing a forward slash in front of "home." Without that slash, Linux assumes you're talking about a directory inside the current one and since it doesn't exist, you get the error. A proper way to do this would be:

    Code:
    cp /home/deejay/lhkv/darkmatter /usr/shar/amsn/plugins/darkmatter
    Registered Linux user #270181
    TechieMoe's Tech Rants

  6. #6
    Just Joined!
    Join Date
    Apr 2009
    Posts
    38
    your method worked flawlessly reed9 and thanx for the advice techimoe

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...