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 3 Days Ago
MadeInGermany MadeInGermany is offline Forum Advisor  
Registered User
Join Date: May 2012
Last Activity: 24 April 2017, 7:57 AM EDT
Location: Simplicity
Posts: 3,499
Thanks: 273
Thanked 1,160 Times in 1,053 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 (3 Days Ago)