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.
- 01-27-2013 #1Just Joined!
- Join Date
- Sep 2012
- Posts
- 95
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
- 01-27-2013 #2Linux Guru
- Join Date
- Oct 2007
- Location
- Tucson AZ
- Posts
- 2,507
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?
- 01-27-2013 #3Just Joined!
- Join Date
- Sep 2012
- Posts
- 95
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!!
- 01-27-2013 #4Just Joined!
- Join Date
- Sep 2012
- Posts
- 95
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 thisthis 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.Code:#!/bin/bash cp /Update/* /TEST/* exit
- 01-29-2013 #5Linux Guru
- Join Date
- Oct 2007
- Location
- Tucson AZ
- Posts
- 2,507
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.
- 01-29-2013 #6Just Joined!
- Join Date
- Sep 2012
- Posts
- 95
thank you we got it all figured out thanks for the quick replies guys it was really helpful.



