SharpDeveloper
Recursively extract files
i want to recursively unzip into proper folder
so i have
/home/abdullah/quran1/files.zip
/home/abdullah/quran2/files.zip
…
/home/abdullah/quranfolder/files.zip
…
/home/abdullah/quranfolder/files.zip
best way to search inside php files for text yoursearchtexthere
find . -name '*.php' -exec grep --with-filename --line-number 'yoursearchtexthere' {} \;
i simply want to unzip all of them at once, here is the shell script to do it in linux:
find -maxdepth 1 -mindepth 1 -type d | while read line; do unzip $line/*.zip -d $line ; done
This way is problematic if any of the folders have spaces in them
this way is better
for dir in */; do ( cd "$dir" && unzip *.zip ); done
Ref: http://unix.derkeiler.com/Newsgroups/comp.unix.misc/2005-03/0006.html
Here is an application of method 1 above, delete all files with 2008 in the name
find -name *2008* | while read line; do rm -f $line ; done
Related Reading:
Other Interesting Posts
-
Articles
- January 2011
- April 2010
- March 2010
- February 2010
- January 2010
- August 2009
- July 2009
- June 2009
- May 2009
- April 2009
- February 2009
- December 2008
- November 2008
- October 2008
- July 2008
- June 2008
- May 2008
- April 2008
- March 2008
- February 2008
- December 2007
- November 2007
- October 2007
- September 2007
- August 2007
- July 2007
- June 2007
- May 2007
-
Meta







