Tagged Questions
5
votes
3answers
232 views
find -exec in bash script with variable expansion
I'm trying to run a command similar to the one below in a bash script. It should search through all subfolders of $sourcedir and copy all files of a certain type to the root level of $targetdir.
...
1
vote
2answers
227 views
How to search and replace text in all php-files in a directory and it's subdirectories
I am looking for a shell script that recursively traverses all .php files in a directory and performs a search & replace of a particular text pattern.
The search pattern is quite long ( > 5000 ...
3
votes
1answer
76 views
'find' across directories named …/dirnameXX/… with XX variable
I am executing this command to find certain files in specific directory:
find ./rgs/test/maesXX/master/stdlist -name \*.extract \
-mtime +30 \! -size 0 -exec ls -lrt {} \;
where XX could be ...
3
votes
1answer
202 views
Storing `find` parameters in a variable
I'm running the following bash command:
find . \( -iname '*.aif' -o -iname '*.pdf' -o -iname '*.exe' -o -iname '*.mov' \
-o -iname '*.doc' \) -exec rm -f {} \;
I'm running the same parameters ...
3
votes
3answers
156 views
Best way to work through / display a tree of images sorted by size
I've got a deep directory tree containing .PNG files. I'd like to find all the .PNG files in the directory, sort them in order of size from smallest to largest, and then display every 50th image.
...