Search Results

Search: Posts Made By: gold2k8
1,571
Posted By rdrtx1
Lke Don Cragun stated, be careful before you run...
Lke Don Cragun stated, be careful before you run rm:

find . -type f \( -iname "*.xml" \) -printf '%T@ %p\n' |
sort -rg |
sed -r 's/[^ ]* //' |
awk '{w=$0; sub(".*/", "", w);...
1,571
Posted By rdrtx1
find . -type f \( -iname "*.xml" \) -printf '%T@...
find . -type f \( -iname "*.xml" \) -printf '%T@ %p\n' | sort -rg | sed -r 's/[^ ]* //' | awk '{w=$0; sub(".*/", "", w); sub("_[0-9_][0-9_]*.*", "", w);} !a[w]++'
1,571
Posted By Don Cragun
Untested, but should be close to what you need. ...
Untested, but should be close to what you need. If the list of rm commands produced by the following looks correct, remove the echo and run it again to actually remove the files:
#!/bin/bash
ls -t...
Showing results 1 to 3 of 3

 
All times are GMT -4. The time now is 12:52 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy