Home Messages Index
[Date Prev][Date Next][Thread Prev][Thread Next]
Author IndexDate IndexThread Index

Re: [linux-users] Applying Changes to All Files in All Subdirectories

Roy Schestowitz wrote:
I am faced with a problem which has probably been dealt with many times before.
I have a list of hundreds(ish) of directories
(12082005,13082005,..,01092005,...) and each contains about 20 items. I need to
use a tool that applies an operation to all files in /one/ given directory.
Since the tool is mounted onto a GUI, I cannot embed anything in a script.

Are you really forced to go through one particular piece of software ? If you need to know if this feature is available in that tool, I guess you need to ask your vendor. ;-) If you are able to write something to handle the attribution change in a third party tool, hopefully the find(1) command will be everything you wish it was and more, e.g.


     find . -type f -path '*dirname/' -exec command {} \;

Here is once approach I had in mind: I would like to 'flatten' the directory
structure, allowing me to apply the changes in 'batch mode' and then returning
all files to their original sub-directories. Is this somehow possible to do?

Here you're going to need to write a script which will store the original directory a file is in, in some kind of database - whether it's a plain text file, or you write a script to archive the data in some kind of RDBMS - the latter will be more complex, but will enable you to do shift the data around with some flexibility should you want to, in an easy to use interface, and it might even be faster than trying to handle an enormous plain text file holding the same thing.




-a

http://lists.manchester.ac.uk/mailman/listinfo/linux-users

[Date Prev][Date Next][Thread Prev][Thread Next]
Author IndexDate IndexThread Index