I was wondering if there is a tool or method to check which files have been modified in multiple directories. I have a copy of the files in the same directory structure that I am sure it was not touch and another that is the one I want to check against the first one. I know diff is out there for that, but I just don't want to check one file at the time.
Thank you.
diff -ru <fist_dir> <second_dir> should do it.
Related
I need something that can copy a specified file any and everywhere on my drive (or computer) where that file already exists; i.e. update a file. I tried to search this site, in case I'm not the first, and found this:
CMD command line: copy file to multiple locations at the same time
But not quite the same.
Example:
Say I have a file called CurrentList.txt, and I have copies of it all over my hard drive. But then I change it and I want all the copies to update. So I want to copy the newer one over all the others. It could 'copy if newer', but generally I know it's newer, so it could also just find every instance and copy over it.
I was originally going to use some kind of .bat file that would have to iterate over every folder seeking the file in question, but my batch file programming is limited/rusty. Then I looked to see if xcopy could do it, but I don't think so...
For how I will use it most, I generally know where those files are going to be, so it actually might be as good or better if I could specify it to (using example), "copy CurrentList.txt, overwriting all other copies wherever found in the C:\Lists folder and all subfolders".
I would really like to be able to have it in a context menu, so I could (from a file explorer) right click on a file or selected files and choose the option to distribute it.
Thanks in advance for any ideas.
Use the "replace" command...
replace CurrentList.txt C:\Lists /s
I do not know what it is called but this is what I am wanting to do. Imagine that you have a directory named (program) then you have three other directories beneath that named 1,2,3. Each of these have 10 files in them either in python or php or what ever.
What I am wanting to do is change a little bity bit of code in each one using a find and replace in notepage ++. Is there a way to basically have every file combined for this one find and replace then when you are done just save it and have them go back into the individual files and directories like before. Is this even possible, has anyone even wanted to do this?
I need to check the files of a versioned system. To do that, I need to write a batcha program so to compare the contents of several folders containing the repositories.
So, my question is: how can I "read" the names of all the subfolders inside a folder, so to use these names later to find subfolders having the same names in a different repositories?
I suppose I may use DIR to print on the screen a list of these names but I don't know how to write it on a text file and then read it. Moreover, I should edit this kind of list, anyway.
Any suggestions or new ideas to solve this problem?
I thank gratefully who ever will answer.
it seems that you can get the subfolders using batch file from perl as follows:
system("start C:\\Temp\\mybatchfile.bat");
or you might try to pass your command suggested by #Stephan straight to system and try to handle what it is returned.
I've been doing a little research, and I haven't find anything remotely similar to what I'm looking at, so here's my case:
I have a folder, lets name it MasterFolder
So, lets say that my MasterFolder, has inside of it, four more folders, I know I can use
cd C:\MasterFolder\
to leave my CMD console just on top of those so, for didactic meanings, lets call them:
- Folder_A
- Folder_B
- Folder_C
- Folder_D
So, inside each of those folders, there are even more folders, that are named
"EncodingMaster_Originals"
the name is the same for all, so, that way, we could say that the folders are, for example:
- Folder_A\EncodingMaster_Originals (and OTHER files that I won't delete)
- Folder_B\InsideFolder_B\EncodingMaster_Originals (In another folder inside Folder_B
Those two are the most simple examples.
So, what I want to do?
Well, is simple, I just want to delete the folder named
"EncodingMaster_Originals"
from each of the folders, without having to be going into each one (There's around 200 folders with those little ones inside, I've made some massive re-encoding of files, and those folders appeared from nowhere).
I think that I've to use this line of code:
rd
(the Remove directory command), but my problem is that I don't know what I have to tell to the RD command, I don't want to look more dumb so I won't type what I've tried, because it was obviously wrong.
If you could help me, I would appreciate it.
So, after a brief search with a different bunch of words. I found THIS post:
How to remove all folders of name x within a directory using cmd/batch file
And the answer is this comment:
https://stackoverflow.com/a/10399706/4625105
Thanks if you were about to answer, I think the case is closed.
I have a problem when trying to upload multiple files to one WinSCP directory, i can manage to copy just one single file, but the problem is that i need to upload many files that are generated by a software, the names are not fixed ones, so i need to make use of wildcards in roder to copy all of them, i have tried many variants on the code, but it all was unsuccessful, the code i am using is:
open "sftp://myserver:MyPass#sfts.us.myserver.com" -hostkey="hostkey"
put "C:\from*.*" "/Myserverfolder/Subfolder/"
exit
This code does actually copy the first alphabetically named file, but it ignores the rest of the files.
Any help with it would be much appreciated
Try this in script
Lcd C:\from
Cd Myserverfolder/Subfolder
Put *
Try and do all manually first so you can see what's going on.