Find the answer to your Linux question:
Results 1 to 2 of 2
Like Tree1Likes
  • 1 Post By alf55
I have been trying to move a file, abc under Dir A to Dir B. And my pwd is Dir A. Here is the command: Code: cp abc /B The ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Nov 2012
    Posts
    6

    Moving files from one Dir to another


    I have been trying to move a file, abc under Dir A to Dir B.
    And my pwd is Dir A.
    Here is the command:
    Code:
    cp  abc /B
    The error message is:
    cp: cannot create regular file `/B': Permission denied

  2. #2
    Linux Enthusiast
    Join Date
    Jan 2005
    Location
    Saint Paul, MN
    Posts
    636
    By using
    /B
    you are saying the the directory B is at the top level (/). Try:
    Code:
    cp path_to_A/A/abc path_to_B/B/
    or
    Code:
    cd  path_to_A/A
    cp abc path_to_B/B/
    CPE2012 likes this.

Posting Permissions

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