Handy Utilities

Handy utilities:
1. Remove file extensions - say we have 1000s .txt files, we need to remove the .txt extension, eg. bug.txt  -> bug

find . -name "*.txt" -exec rename .txt '' {} +

  • {} + works the same way as fine's '-print0 | xargs -0 action', which works on a subset instead of every single line.
  • rename takes 3 arguments, rename from to files, eg. rename .txt .text *.txt renames all *.txt to .text