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: 23 July 2017, 10:10 AM EDT
Location: Simplicity
Posts: 3,636
Thanks: 285
Thanked 1,217 Times in 1,100 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

find * -type f -mtime -365 |
# replace a trailing .xxx with *
  sed 's/[.][^.]*$//' |
# Remove duplicates

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)