Find the answer to your Linux question:
Results 1 to 3 of 3
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    quick one about cp and mv commands


    hi guys,

    when copying or moving files or directories using cp or mv

    do you have to be in that working directory (be where the files or dirs are that you want to copy) whats the quickest way to do this as i find some paths really long...is there a trick or secret to doing this?

    thanks
    j0n1n

  2. #2
    Penguin of trust elija's Avatar
    Join Date
    Jul 2004
    Location
    Either at home or at work or down the pub
    Posts
    3,839
    No. You can be anywhere the file system and use absolute paths (starting from the root). Personally, I usually end up in the destination directory so I can simply use . to mean to here
    Code:
    cp -R /home/someuser/filesinareallylongdirectoryname/to/copy .
    however the tab key is your friend when typing at the command line. Enter the first few characters and press tab...
    Code:
    cp -R /home/some<TAB>/fil<TAB>/to/copy .
    You'll love it
    Should you be sitting wondering,
    Which Batman is the best,
    There's only one true answer my friend,
    It's Adam Bloody West!


    The Fifth Continent

  3. #3
    thanks for that man...this truly is the best forum i have ever laid my fingers on...

  4. $spacer_open
    $spacer_close

Posting Permissions

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