Unix/Linux Go Back    



Find command + replace the extension (.xxx) by *

UNIX for Beginners Questions & Answers




Kindly Note - This is a Single User Post by Forum Member MadeInGermany Regarding:
Find command + replace the extension (.xxx) by *.
Please Follow The Primary Link Above to View the Full Discussion.

   
Old Unix and Linux 04-21-2017
MadeInGermany MadeInGermany is offline Forum Advisor  
Registered User
 
Join Date: May 2012
Last Activity: 28 May 2017, 1:23 PM EDT
Location: Simplicity
Posts: 3,548
Thanks: 277
Thanked 1,181 Times in 1,069 Posts
... or the script is run with "sh -x"; the -x option also turns on the debug mode.

The following will run faster, and log less in debug mode

Code:
find * -type f -mtime -365 |
# replace a trailing .xxx with *
  sed 's/[.][^.]*$//' |
# Remove duplicates
  sort -u > $MAITUT/BCK_DATA_FILES_TO_DELETE

The pipe passes the output to the next command without a temp file.
The Following User Says Thank You to MadeInGermany For This Useful Post:
royinfo.alain (04-21-2017)