jb_fvwm2
November 11th, 2011, 05:39
Some may keep distfiles in /usr/ports/distfiles, say if a port has a minor version bump and one does not wish to re-dowload. However, there may be
Thisport-1.gz
Thisport-2.gz etc which were inadvertantly left behind, say by an interrupted
portmaster run or equivalent.
# only've tried it with gnuls
cd /usr/ports/distfiles
gnuls -R "*.Z" "*.zip" "*.bz2" "*.gz" "*.tgz" -1 | sort | tee -a /tmp/fil.1
tr -d "[:digit:]" < fil.1 > fil.2
cat fil.2 | uniq -d
If one is fortunate, only a few extra files to delete will be shown by the last command in the sequence, and one's shell (if configured to) can complete the filenames as one deletes the duplicates.
[I discovered the gnuls part previously, but only very recently the freebsd-questions list mentioned the tr command.]
.....
Not quite yet able to use the suggestions below as I've many .dat, subdirectories (etc) in /usr/ports/distfiles from the days I saved every other file there, comments, coding tests etc. ( .. and busy at the moment with other configuration tasks...)
Thisport-1.gz
Thisport-2.gz etc which were inadvertantly left behind, say by an interrupted
portmaster run or equivalent.
# only've tried it with gnuls
cd /usr/ports/distfiles
gnuls -R "*.Z" "*.zip" "*.bz2" "*.gz" "*.tgz" -1 | sort | tee -a /tmp/fil.1
tr -d "[:digit:]" < fil.1 > fil.2
cat fil.2 | uniq -d
If one is fortunate, only a few extra files to delete will be shown by the last command in the sequence, and one's shell (if configured to) can complete the filenames as one deletes the duplicates.
[I discovered the gnuls part previously, but only very recently the freebsd-questions list mentioned the tr command.]
.....
Not quite yet able to use the suggestions below as I've many .dat, subdirectories (etc) in /usr/ports/distfiles from the days I saved every other file there, comments, coding tests etc. ( .. and busy at the moment with other configuration tasks...)