Linker IT Software
Google
Web www.oraxcel.com
menubar-top-links menubar-top-rechts
Home Help Search Login
Welcome, Guest. Please Login.
SQL*XL: Database to Excel bridge litLIB: Excel power functions pack ExcelLock: Locking and securing your valuable Excel spreadsheets encOffice: Protect your Excel file easy and safe encOffice: Protect your Excel file easy and safe
Pages: 1
Recursive file search in unix/linux (Read 2259 times)
Gerrit-Jan Linker
YaBB Administrator
*****




Posts: 75
Recursive file search in unix/linux
21.08.08 at 09:24:02
 
Recursive file search in unix/linux
 
To recursively search for files in unix or linux the find command can be used. As an example the following command lists all the files from the current directory downwards that match the pattern *output*
 
find . -name *output* -print
 
Other examples:
Find all files/directories whose name only contain numbers:
find . -name "[0123456789]*" -print
Back to top
 
« Last Edit: 09.10.08 at 13:18:17 by Gerrit-Jan Linker »  

Gerrit-Jan Linker
Linker IT Software
Email WWW Gerrit-Jan Linker   IP Logged
Gerrit-Jan Linker
YaBB Administrator
*****




Posts: 75
Recursive delete files in unix/linux
Reply #1 - 18.09.08 at 14:12:05
 
Recursive delete files in unix/linux
 
To recursively delete all files that match a certain pattern does not work with the rm -R command. I use the following command instead:
 
find startdir -name pattern -exec rm {} \;
 
Example:
Delete all files with the word output in the file name in the current directory and all sub directories:
 
find . -name *output* -exec rm {} \;
Back to top
 
« Last Edit: 09.10.08 at 13:07:11 by Gerrit-Jan Linker »  

Gerrit-Jan Linker
Linker IT Software
Email WWW Gerrit-Jan Linker   IP Logged
Gerrit-Jan Linker
YaBB Administrator
*****




Posts: 75
Recursive delete files of certain size in unix
Reply #2 - 27.06.09 at 23:36:46
 
Recursive delete files of certain size in unix
 
find . -type f -size -200 -exec rm {} \;
 
Removes files below size 200 (don't know which units. Not bytes)
Back to top
 
 

Gerrit-Jan Linker
Linker IT Software
Email WWW Gerrit-Jan Linker   IP Logged
Pages: 1