Find the answer to your Linux question:
Results 1 to 6 of 6
Hey Peoples Me and my friend are trying to make a bash updater because we have another program that we made that we are going to updating a lot and ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux Newbie
    Join Date
    Sep 2012
    Posts
    148

    Talking Bash help for moving files


    Hey Peoples Me and my friend are trying to make a bash updater because we have another program that we made that we are going to updating a lot and we have people that use our program and we need to make the updater move all the new updated files to their directories. please help thank you if you need any more info please let me know. thanks

  2. #2
    Linux Guru
    Join Date
    Oct 2007
    Location
    Tucson AZ
    Posts
    3,105
    More specifics are probably needed. Are you going to be moving the files from a specific directory to other specific directories? Are you going to be moving all files in a directory to other directories? or just some files from a directory/directories to otherdirectories?

  3. #3
    Linux Newbie
    Join Date
    Sep 2012
    Posts
    148
    Well we are trying to copy files from our root directory into all of our users directory. We have all of our user's directories stored on a server and we really don't want to go through all of them and manually put files in that's why we were going to go ahead and just try to make a script for updating all of the user directories at once. But yeah we are trying to move files from a specific directory to other specific directories. Thanks for the quick reply!!

  4. #4
    Linux Newbie
    Join Date
    Sep 2012
    Posts
    148
    also i thought that i would include this pic of the error message that comes up from the code we are using. Capture.jpg
    also the code that we have down so far is this
    Code:
    #!/bin/bash
    cp /Update/* /TEST/*
    exit
    this is just for a test as we are very new to Bash and are just trying to see if we can get a script working that will allow us to copy multiple files to multiple directories at the same time.

  5. #5
    Linux Guru
    Join Date
    Oct 2007
    Location
    Tucson AZ
    Posts
    3,105
    You need to remove the asterisk from after /TEST/. If you want to copy recursively, with sub-directories you need to indicate that with an option, -R. The site below has some info on this:

    Linux and UNIX cp command help and examples

    You also need the full path. Your example above will copy one sub-directory Update to another sub-directory /TEST in the same directory.

  6. #6
    Linux Newbie
    Join Date
    Sep 2012
    Posts
    148
    thank you we got it all figured out thanks for the quick replies guys it was really helpful.

Posting Permissions

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